I subscribed to your channel few days back and till now I think you are one of the best tutors I found on youtube for DSA. god bless you and thank you for covering all approaches.
@codestorywithMIK8 ай бұрын
✨ Timelines✨ 00:00 - Introduction 0:18 - Problem Explanation 5:52 - Approach-1 Intuition 9:10 - Time and Space Complexity of Approach-1 9:58 - Important Note 12:51 - Coding Approach-1 14:50 - Approach-2 Explanation 16:39 - Time and Space Complexity of Approach-2 17:52 - Coding Approach-2 19:41 - Approach-3 Detailed Explanation 39:45 - Coding Approach-3
@oqant04248 ай бұрын
Using your story--> code method , I solved it on my own Came here to see a better approach ❤❤
@Ankitkumar-fz3kc8 ай бұрын
Thanks for 3rd approach it's very difficult to come up with it but you made easy thanks.
@wearevacationuncoverers8 ай бұрын
Nailed the 3rd Approach. Thanks a lot man. You always mesmerise me.
@aws_handles8 ай бұрын
I am a big fan of your explanation. Every time i learn something new. Thanks a lot for the 3rd approach
@gui-codes2 ай бұрын
Awesome explanation
@ishwarreddy88208 ай бұрын
bhaiya aise hi guide karte rahiye boht help hota hai
@thekindspill8 ай бұрын
Was waiting for your upload, thank you mik❤️
@utkarshsahay99088 ай бұрын
class Solution { public: int findLeastNumOfUniqueInts(vector& arr, int k) { unordered_map mpp; for(int num : arr) mpp[num]++; vector vec; for(auto it : mpp) vec.push_back(it); sort(vec.begin(),vec.end(),[] (auto a,auto b){ return a.second < b.second; }); int ans = vec.size(); for(auto &it : vec){ if(k >= it.second){ k -= it.second; } else if(k < it.second || k == 0){ break; } ans--; } return ans; } };❤❤
@revolverlim.64448 ай бұрын
just a suggestion give the similar qus as hw at the end and link of the similar question in the github
@codestorywithMIK8 ай бұрын
sure thing.
@parthbhatti41518 ай бұрын
@@codestorywithMIK yes please 🙏
@bhuppidhamii8 ай бұрын
yes
@devmadaan51468 ай бұрын
No please no,😢
@rohitshah89048 ай бұрын
Awesome explanation ❤ One doubt .. why k
@bitandutta31518 ай бұрын
Thank you mik ❤
@tutuimam33818 ай бұрын
Thanks a lot
@divyamdubey93338 ай бұрын
Bro video tags would be really helpful
@codestorywithMIK8 ай бұрын
Sure thing Divyam. ✨ Timelines✨ 00:00 - Introduction 0:18 - Problem Explanation 5:52 - Approach-1 Intuition 9:10 - Time and Space Complexity of Approach-1 9:58 - Important Note 12:51 - Coding Approach-1 14:50 - Approach-2 Explanation 16:39 - Time and Space Complexity of Approach-2 17:52 - Coding Approach-2 19:41 - Approach-3 Detailed Explanation 39:45 - Coding Approach-3
@dipesh52938 ай бұрын
awsome
@oqant04248 ай бұрын
Thanks bhaiya :)
@AmanKumar-qz4jz8 ай бұрын
why only 18k subs.....man deserves lot more!!! guys please subscribe
@jagadeeshp11638 ай бұрын
d={} for i in arr: d[i]=d.get(i,0)+1 count=len(d) arr.sort(key=lambda x:d[x]) cnt=0 for i in arr: cnt+=d[i] for i in range(k): t=arr.pop(0) d[t]-=1 if d[t]==0: count-=1 return count why is my code failing cases ?
@maritime_business8 ай бұрын
3rd approach toh interview ke time pe koi strike kar hi nhi paega, specially agar kisi ne phle se na kia ho there is no point in that specially that divide logic and then taking minimum, its too complicated :/
@AryanAryan-ks5ib8 ай бұрын
Hello sir hello can I get the greedy playlist mujhe mili ni and also can u build the discord server it will be helpful haha
@AryanAryan-ks5ib8 ай бұрын
Edit: sorry I got the playlist bt what about the discord server
@oqant04248 ай бұрын
can anyone explain this part if(k
@codestorywithMIK8 ай бұрын
current frequency is freq further in for loop, we will be getting higher frequency because with every loop we are doing freq++ in the for loop. Now, suppose we reach a point where k
@saurabhKumar-hj6yp8 ай бұрын
❤❤
@shabananoor94238 ай бұрын
❤❤
@parththakkar64018 ай бұрын
class Solution { public: int findLeastNumOfUniqueInts(vector& arr, int k) { mapmp; for(int i=0;i
@mursalinhawlader64078 ай бұрын
class Solution { public: int findLeastNumOfUniqueInts(vector& arr, int k) { mapmp; for(int i=0;isecond); } sort(v.begin(),v.end()); int i=0; while(i=k){ int x=abs(v[i]-k); v[i]=x; k=0; } else{ int x=abs(k-v[i]); k=x; v[i]=0; } i++; } int c=0; for(int i=0;i0)c++; } return c; } };
@manimanohar_0018 ай бұрын
First view
@dayashankarlakhotia49438 ай бұрын
public int findLeastNumOfUniqueInts(int[]arr,int k){ Mapmpp=new HashMap(); for(int i:arr) mpp.merge(I,1,Integer::sum); PriorityQueuepq=new PriorityQueue(mpp.values()); while(k>0) k-=pq.poll(); return pq.size()+(k