Move Zeroes (LeetCode 283) | Full Solution explained with examples | Study Algorithms

  Рет қаралды 19,289

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Пікірлер: 40
@HarshPatel-hu5sr
@HarshPatel-hu5sr Жыл бұрын
I honestly love your way of teaching, you would make an AMAZING professor
@nikoo28
@nikoo28 Жыл бұрын
Wow, thank you!
@reactninja6567
@reactninja6567 2 жыл бұрын
Hands Down this is the best soln i have seen so far thanks! keep on going.
@avengersshorts5949
@avengersshorts5949 2 ай бұрын
3:33 I Completed solving this problem in leetcode thank you ❤
@saichaithrik7134
@saichaithrik7134 8 ай бұрын
Your way of teaching is one the best i have ever seen thank you sir
@supershinobi7892
@supershinobi7892 Жыл бұрын
you have made my coding journey very easy and understandable
@ahmar8462
@ahmar8462 Ай бұрын
On point and quick to grasp explanation. Keep posting
@souravsarkarofficials
@souravsarkarofficials 2 ай бұрын
Bhaiya apki samjhane ki tarika sach mei pura alag hei ...koi nhi rok sakta apko DSA mei 💪💪💪💪
@abhinavd2
@abhinavd2 Жыл бұрын
one of the best teacher ever studied😍
@kashikasinghal3250
@kashikasinghal3250 2 ай бұрын
thank you for teaching the best and efficient approach. before watching this video i was struggling with the approach as mine took 336ms and the other videos were complex to understand, although it was only 5 min long but i couldn't get a loop;) nut this approach solved it in only 7ms...like this is crazy!
@TejwantDataLab
@TejwantDataLab 2 ай бұрын
Thank you sir, really good explaination
@mohanupreti4654
@mohanupreti4654 Ай бұрын
Very fine explanation
@UjjwalRaj-CSE-
@UjjwalRaj-CSE- 4 ай бұрын
I am watching your video first time, you are great
@TechnicalMasterAman
@TechnicalMasterAman Жыл бұрын
under if condition, we can just do swap(nums[i],nums[insertPos])
@deeptidip9864
@deeptidip9864 2 жыл бұрын
Such an easy explanation💫
@ramielwan48
@ramielwan48 Жыл бұрын
Man I swear I asked chat gpt to explain it to me. I read the leetcode solution, and watched 2 other videos but none of them made sense to me. I wanted to understand how to approach it and not just copy and paste the solution. When you explained it, I was like damn that's easy 😅
@nikoo28
@nikoo28 Жыл бұрын
That is so nice of you. :)
@vishwamitrasingh2667
@vishwamitrasingh2667 2 ай бұрын
Great sir 🙏🙏🙏
@ajayupadhyay4964
@ajayupadhyay4964 Жыл бұрын
you are a really great teacher !!
@nikoo28
@nikoo28 Жыл бұрын
Wow, thank you!
@LuckyAndDad
@LuckyAndDad Жыл бұрын
Thank you brother
@viveknamdev2605
@viveknamdev2605 8 ай бұрын
Nice Explanation by you
@jagratsahoo6885
@jagratsahoo6885 2 ай бұрын
Thanks Nikhil
@khaleabhishek5023
@khaleabhishek5023 Жыл бұрын
amazing keep going
@sammedpatil3907
@sammedpatil3907 11 ай бұрын
Very Nice Explanation
@nikoo28
@nikoo28 11 ай бұрын
Thanks and welcome
@dewanshanand1395
@dewanshanand1395 2 жыл бұрын
Amazing !!
@pulastyadas3351
@pulastyadas3351 2 жыл бұрын
You are really awesome❤
@shubhamkumar-um2xi
@shubhamkumar-um2xi 7 ай бұрын
Great brother
@Sakeer89
@Sakeer89 Жыл бұрын
Very easy solution
@shubhamkumar-um2xi
@shubhamkumar-um2xi 7 ай бұрын
Very nice
@vis2043
@vis2043 2 ай бұрын
Two pointer approach is also better one
@alexivuckovich8005
@alexivuckovich8005 4 ай бұрын
Loving all the videos so far, but with this one it seems incorrect to say it's O(n) becuase the array is iterated over only once. I think it's actually of O(n) because it's simplified from O(2n) in the worst case that the array is all zeros. What about adding a line a code before inserttPosition is incremented that checks if i > insertPosition and just set the i-th element to zero then?
@nikoo28
@nikoo28 4 ай бұрын
O(2n) simplifies to O(n)
@karthik-varma-1579
@karthik-varma-1579 6 ай бұрын
nikhil awaiting for the sheet that you said will release!!!
@nikoo28
@nikoo28 5 ай бұрын
Will release it soon
@tufanpondu9511
@tufanpondu9511 Жыл бұрын
Sir you make me bound to subscribe to your channel and give like.😍😍😍😍
@nikoo28
@nikoo28 Жыл бұрын
glad to have you as my audience :)
@Vasoya_Jaydeep
@Vasoya_Jaydeep 7 ай бұрын
This will take O(n + number of zeros) Time Here is one more solution with O(n) Time void moveZeroes(vector& nums) { int Pi =0 , Zi = 0; while(Pi < nums.size()) { if (nums[Zi] == 0) { while((Pi < nums.size()) && !nums[Pi]) { Pi++; } if (Pi >= nums.size()) break; int tmp = nums[Zi]; nums[Zi] = nums[Pi]; nums[Pi] = tmp; } Zi++; Pi++; } } /*End*/
@rajdeepdas8393
@rajdeepdas8393 6 ай бұрын
Just what the fuck happened......
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 395 М.
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 3,9 МЛН
когда не обедаешь в школе // EVA mash
00:51
EVA mash
Рет қаралды 3,9 МЛН
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 5 МЛН
Python Programming Practice: LeetCode #283 -- Move Zeroes
10:53
How to move Zeroes to end of an Array? | Animation
14:45
Dinesh Varyani
Рет қаралды 39 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 241 М.
Move Zeroes - Leetcode 283 - Python
8:15
NeetCode
Рет қаралды 77 М.
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19