Minimum Number of Pushes to Type Word I and II | Leetcode 3014 | Leetcode 3016 | Weekly Contest

  Рет қаралды 7,942

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 63
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Hi MIK, I couldn't solve any Qn. Even Easy one was also very tricky to me. But I will upsolve them now. Thanks for the explanation.
@Ramneet04
@Ramneet04 Жыл бұрын
I did this in one go, both the questions. Did the optimal one. Didn't use map in first question and used vector and did sorting in the second question. And here what I did in my first question where there is No need of map we can do only by a for loop. Int curr=1; Int ans=0; For(int i=0;i
@imPriyansh77
@imPriyansh77 5 ай бұрын
I used Max-Heap Priority Queue
@arkojeetbera8584
@arkojeetbera8584 Жыл бұрын
Eagerly waiting for prob4: count no. of houses at a certain distance II
@FanIQQuiz
@FanIQQuiz Жыл бұрын
Yayyyyy contest videos are here.....Thanks a lot.
@durgeshkushwaha2534
@durgeshkushwaha2534 11 ай бұрын
Really great explanation❤❤
@souvikadhikary2429
@souvikadhikary2429 Жыл бұрын
i took 2 hrs to solve this question. still not pass all tcs huge respect man such a awsome doubt solver
@codestorywithMIK
@codestorywithMIK Жыл бұрын
❤️❤️🙏🙏
@Engineering.Wallah
@Engineering.Wallah 5 ай бұрын
int ans=0; vectorv(26,0); for(auto c:word) v[c-'a']++; sort(v.begin(),v.end()); for(int i=25;i>=0;i--){ if(v[i]==0) return ans; if(25-i
@nikhilhaspe2734
@nikhilhaspe2734 5 ай бұрын
this also works: class Solution { public int minimumPushes(String word) { int[] charCount = new int[26]; for(int i=0; i
@pranavjawale01
@pranavjawale01 5 ай бұрын
class Solution { public: int minimumPushes(string word) { unordered_map mp; for (char c : word) { mp[c]++; } if (mp.size() 8 && mp.size() < 17) { return 8 + (mp.size() - 8) * 2; } if (mp.size() > 16 && mp.size() < 25) { return 8 + 16 + (mp.size() - 16) * 3; } return 8 + 16 + 24 + (mp.size() - 24) * 4; } };
@AryanVats603
@AryanVats603 5 ай бұрын
Did it myself easily sir!❤️
@varanasibindu8987
@varanasibindu8987 11 ай бұрын
Thank you for great explanation, very helpful .
@DevOpskagyaan
@DevOpskagyaan Жыл бұрын
Bhai legend ho aap 🙏🏻🔥
@ReshuSharma-jc7yu
@ReshuSharma-jc7yu 5 ай бұрын
MIK bhaiya pls upload weekly and bi weekly contest soln pls as the way you explain any problem give me more clarity about the topic
@priyanshuprajapat8822
@priyanshuprajapat8822 Жыл бұрын
Very Well Explained❤‍🔥
@beenasatyendrapal6405
@beenasatyendrapal6405 Жыл бұрын
🤗story ---> done
@gauravbanerjee2898
@gauravbanerjee2898 5 ай бұрын
Thanks a lot bhaiya ❤❤
@aizad786iqbal
@aizad786iqbal 5 ай бұрын
class Solution { public int minimumPushes(String word) { int n = word.length(); int ans = 0; int p=1; int x = 8; while( n >= 0){ if(n
@anuppatankar4294
@anuppatankar4294 Жыл бұрын
Great video 👌
@imPriyansh77
@imPriyansh77 5 ай бұрын
Bhaiya, did today's POTD (3016) on my own...I used Max-Heap Priority Queue. Got time complexity O(n * logn) and space complexity O(26) ~ O(1)
@codestorywithMIK
@codestorywithMIK 5 ай бұрын
❤️❤️❤️
@amanpandey8031
@amanpandey8031 Жыл бұрын
it was really helpful for me thanx a lot
@thefinalfit
@thefinalfit Жыл бұрын
Please Qn-2 also
@priyanshumishra_IITDh
@priyanshumishra_IITDh Жыл бұрын
Hello sir can you please upload solution for today's gfg potd vertex cover
@tutuimam3381
@tutuimam3381 Жыл бұрын
Thanks 👍
@AmarjeetKumar-to9ub
@AmarjeetKumar-to9ub 5 ай бұрын
🔥
@peterfromengland8663
@peterfromengland8663 5 ай бұрын
Did it on my own
@jambajuice07
@jambajuice07 Жыл бұрын
please make video on c of biweekly contest
@adityaraj-zm7zk
@adityaraj-zm7zk 5 ай бұрын
@codestorywithMIK sir yaha pe bata dena ye kaia hua samajh nhi aaya for(char &ch: word) mp[ch - 'a']++;
@DManikandan-cw2cw
@DManikandan-cw2cw Жыл бұрын
​ @codestorywithMIK Buddy plz upload for Biweekly Contest 122 held yesterday
@arjitgautam365
@arjitgautam365 Жыл бұрын
yes, if possible pls upload the solutions
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Will try to upload soon Unfortunately couldn’t get much time ❤️🙏
@alokbhowmik3547
@alokbhowmik3547 Жыл бұрын
Aj ka GFG ka potd ka video bana dijia
@salmaniproductions1104
@salmaniproductions1104 5 ай бұрын
Thank you bhaiiya
@dayashankarlakhotia4943
@dayashankarlakhotia4943 Жыл бұрын
please make video on qn.no2&no4.graph problem.
@benoitblanc-zl8rc
@benoitblanc-zl8rc Жыл бұрын
Thanks man ❤
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Mik , please post Problem 2 solution.
@amansaurabh4552
@amansaurabh4552 Жыл бұрын
Bhaiya plz make video on today's GFG POTD
@FanIQQuiz
@FanIQQuiz Жыл бұрын
Waiting for Qn-2 of weekly contest.
@harshitsoni8456
@harshitsoni8456 Жыл бұрын
Bhai please add 2 and 4th also
@HI-wl9el
@HI-wl9el Жыл бұрын
Doubt ::: Consider i am in a OA. Problem dp ka hai ... If my memo dp is accepted. So should i go for tabulation ???? Like that will increase my chance of selection ??? (bcoz of improved sp complexity) Or will it decrease (due to more no of submission)
@codestorywithMIK
@codestorywithMIK Жыл бұрын
No. If all test caes are accepted, run to the next qn. During face to face interview, you can discuss bottom up
@HI-wl9el
@HI-wl9el Жыл бұрын
@@codestorywithMIK thanks, sir. But I was thinking of the scenario when all the rest questions are completed !!!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
@HI-wl9el yes definitely in that case, you can try optimal approach
@HI-wl9el
@HI-wl9el Жыл бұрын
@@codestorywithMIK thank you, sir. By the way, I love your style of explaining!
@ashutoshpandey1639
@ashutoshpandey1639 Жыл бұрын
please make video on today's gfg potd
@Engineering.Wallah
@Engineering.Wallah 5 ай бұрын
int ans=0; vectorv(26,0); for(auto c:word) v[c-'a']++; sort(v.begin(),v.end()); for(int i=25;i>=0;i--){ if(v[i]==0) return ans; if(25-i
@deeptijain1096
@deeptijain1096 Жыл бұрын
please upload the solution of latest biweekly contest...........
@rushabhlegion2560
@rushabhlegion2560 Жыл бұрын
Yr sunday ko late kyu nhi rakhte ye contest.
@bhuppidhamii
@bhuppidhamii Жыл бұрын
I think timing is good 😊
@rushabhlegion2560
@rushabhlegion2560 Жыл бұрын
@@bhuppidhamii Nhi yr bro. Roz morning me office jana padta hai. Sirf sunday ek din hota hai sone ke liye.
@bhuppidhamii
@bhuppidhamii Жыл бұрын
@@rushabhlegion2560 oho
@varunaggarwal7126
@varunaggarwal7126 Жыл бұрын
why are we using hashmap? I did it without it class Solution { public: int minimumPushes(string word) { int ans=0; int it=0; int key=1; for(auto &ch: word){ if(it>7){ key++; it=0; } ans+=key; it++; } return ans; } };
@adityaraj-zm7zk
@adityaraj-zm7zk 5 ай бұрын
#codestorywithMIK sir iska slides daal do samhne ke liye please sir
@tutuimam3381
@tutuimam3381 5 ай бұрын
❤❤
@dayashankarlakhotia4943
@dayashankarlakhotia4943 Жыл бұрын
public int minimumPushes (String word){ int[]freq=new int[26]; for(char c:word.toCharArray()){ freq[c-'a']--; } Arrays.sort(freq); int cnt=0; for(int i=0;i
@Ankitkumar-fz3kc
@Ankitkumar-fz3kc Жыл бұрын
class Solution { public: int minimumPushes(string word) { int ans = 0; vector vec(26,0); for(int i = 0 ; i < word.length();i++){ vec[word[i]-'a']++; } sort(vec.rbegin(),vec.rend()); int cnt = 0; for(int i = 0 ; i< 26;i++){ if(cnt < 8 && vec[i]!=0) ans += vec[i]; else if(cnt>=8 && vec[i]!=0){ ans += ((cnt/8)+1)*vec[i]; } else{ break; } cnt++; } return ans; } }; sir this is my solution is it optimised or i can do better
@codestorywithMIK
@codestorywithMIK 11 ай бұрын
This looks good Ankit. Great job.
@faraz9641
@faraz9641 Жыл бұрын
Merse ek b ni bna 🥲🥲
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Same bhai 😥
@rushabhlegion2560
@rushabhlegion2560 Жыл бұрын
1st aur 3rd easy tha bro. Lekin 2nd and 4th is difficult
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
My Brain after 569 Leetcode Problems
7:50
NeetCode
Рет қаралды 2,8 МЛН
Learn Coding & Get a Job (in 2025) 🔥
16:54
CodeWithHarry
Рет қаралды 799 М.
Longest Substring Without Repeating Characters | Amazon
24:00
take U forward
Рет қаралды 297 М.
3016. Minimum Number of Pushes to Type Word II | Greedy | Word I
9:48
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН