Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
Very good explanation with intuition.
Thanks :)
Thanks for a new perspective , which makes more sense as a learner .
Glad it helped :)
Well, I was stuck on this question for two days and was finally able to solve it , but I am amazed by the number of optimizations in your code as compared to mine 😅. Anyways, thanks for such a lovely explanation.
Nice hard work :)
Thanks sir ji
Welcom :)
sir, why do we fix 1 while solving, like items[i][1], we increase the price value but not the beauty value??
items[i][1] is the beauty value of item number i
just commenting for you
Thanks 🙏🏼
class Solution {public: vector maximumBeauty(vector& items, vector& queries) { sort(items.begin(),items.end()); int n=queries.size(); int m=items.size(); for(int i=1;i
👍🏼
if i sort the query and then linear search ?
That will work too :)Sort both and perform linear search on both paralelly using 2 pointer
Very good explanation with intuition.
Thanks :)
Thanks for a new perspective , which makes more sense as a learner .
Glad it helped :)
Well, I was stuck on this question for two days and was finally able to solve it , but I am amazed by the number of optimizations in your code as compared to mine 😅. Anyways, thanks for such a lovely explanation.
Nice hard work :)
Thanks sir ji
Welcom :)
sir, why do we fix 1 while solving, like items[i][1], we increase the price value but not the beauty value??
items[i][1] is the beauty value of item number i
just commenting for you
Thanks 🙏🏼
class Solution {
public:
vector maximumBeauty(vector& items, vector& queries) {
sort(items.begin(),items.end());
int n=queries.size();
int m=items.size();
for(int i=1;i
👍🏼
if i sort the query and then linear search ?
That will work too :)
Sort both and perform linear search on both paralelly using 2 pointer