Very simple and easy to understand approach. Really appreciate this effort from your side
@LeetCodeUniversity19 күн бұрын
Thank you. I am glad you found it helpful!
@vamsiswaroopv54925 күн бұрын
Simple and Handy explanation. Thank You
@LeetCodeUniversity24 күн бұрын
Thank you, glad I was of help!!
@anandsinha1063Ай бұрын
Why you have used strings in hash set
@Emanuel-yb3qkАй бұрын
Thanks for the video.
@LeetCodeUniversityАй бұрын
My pleasure!
@davidabdhir780Ай бұрын
Your channel is so underrated brother. You deserve so much more recognition and subscribers. This content is gold. Thank you so much.
@LeetCodeUniversityАй бұрын
This truly means a lot. Thank you!
@swapnil72Ай бұрын
I did not understand why use the second while loop?
@saleheen12Ай бұрын
Thanks. Only explanation I understood.
@LeetCodeUniversityАй бұрын
I am glad I was able to help!
@amitghosh52 ай бұрын
this was great. I have immediately subscribed
@LeetCodeUniversity2 ай бұрын
Thank you so much!!
@ukpauchechi2 ай бұрын
Thanks for this explanation, wish I could give this more than one thumbs up😊
@LeetCodeUniversity2 ай бұрын
You are so kind. Thank you and glad it was helpful!!
@_4p_2 ай бұрын
Thanks
@chadsmith712 ай бұрын
very good. I am now a subscriber. great work.
@LeetCodeUniversity2 ай бұрын
Appreciate that!
@Jack-ke3wm2 ай бұрын
As always, this has been extremely detailed and beautifully explained!!
@LeetCodeUniversity2 ай бұрын
Thank you! Glad it was helpful!
@RamPageMMA2 ай бұрын
LCU is back!!!!!!!!!!!!! 🎉👏
@LeetCodeUniversity2 ай бұрын
Glad to be back!!!
@RohanKumar-nx2ry2 ай бұрын
this is what i expect from my teacher anyways you teach really good bro😀
@LeetCodeUniversity2 ай бұрын
Thank you! I absolutely love to teach, glad you found it helpful!
@ranjitasahu192 ай бұрын
This is so good approach, thanks a lot.
@LeetCodeUniversity2 ай бұрын
Glad it was helpful!
@RamPageMMA2 ай бұрын
dude, you made this problem look easy. Absolutely amazing explanation.
@RamPageMMA2 ай бұрын
For the reversing part, I tried to reverse each row using two pointer technique. example: for (int i = 0; i < matrix.size(); i++) { int left = 0; int right = matrix[i].size() - 1; while (left < right) { swap(matrix[i][left], matrix[i][right]); left++; right--; } } I utilized the same "swap()" method when transposed the matrix.
@RamPageMMA2 ай бұрын
Here is the full code: class Solution { public: void swap(int &a, int &b) { int temp = a; a = b; b = temp; } void rotate(vector<vector<int>> &matrix) { // transpose matrix for (int row = 0; row < matrix.size(); row++) { for (int col = row; col < matrix[row].size(); col++) { swap(matrix[row][col], matrix[col][row]); } } // reverse each row after transposed for (int i = 0; i < matrix.size(); i++) { int left = 0; int right = matrix[i].size() - 1; while (left < right) { swap(matrix[i][left], matrix[i][right]); left++; right--; } } } };
@LeetCodeUniversity2 ай бұрын
Thank you very much! Glad it was of help to you!
@KittyInCali2 ай бұрын
I went over multiple videos, this was by far the best explanation
@LeetCodeUniversity2 ай бұрын
Thank you! Glad it was helpful!
@AanchalSharma-e4e3 ай бұрын
please upload more questions
@LeetCodeUniversity2 ай бұрын
I will!
@fjose87124 ай бұрын
Is it not simpler to use logarithms? Logarithms convert addtion to multiplication, so we don't need the + symbol...
@alastairhewitt3804 ай бұрын
Fantastic explanation Edit: In the while loop, if I only write p1 >= 0, then I get an index out of bound error, but if I include the logic for p1 & p2 then the code up until that point works properly. I am not really sure why that is since m & n are both 3. Can someone please help explain what I am not seeing? To me it is the same thing
@kousthubganugapati71934 ай бұрын
will this work for every array
@LeetCodeUniversityАй бұрын
For sure!
@nautilus20245 ай бұрын
wow, awesome !
@TheMLGYeet5 ай бұрын
Great job explaining the while loop conditions.
@LeetCodeUniversity5 ай бұрын
Thank you!
@musamehdiyevv5 ай бұрын
Thank you for the explanation. I think this code is simpler: class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int p = m + n - 1; int p1 = m - 1; int p2 = n - 1; while (p2 >= 0) { if (p1 >= 0 && nums1[p1] > nums2[p2]) { nums1[p] = nums1[p1]; p1--; p--; } else { nums1[p] = nums2[p2]; p2--; p--; } } } }
@sarahussain72486 ай бұрын
Thank you, your explanation is amazing ❤
@LeetCodeUniversity6 ай бұрын
I appreciate that! That was my first video. I highly suggest you see the rest if you liked this one. They only got better!
@legna5166 ай бұрын
Please continue your content, much appreciated! Liked and subscribed.
@LeetCodeUniversity6 ай бұрын
I really appreciate you!
@StfuSiriusly7 ай бұрын
great explanation, I was hoping to find more but this seems to be your last video. Any plans to make more?
@LeetCodeUniversity7 ай бұрын
Thank you so much! Yes, I might come back to doing them. At least, I hope the videos I have helped you become a little better!
@1murkeybadmayn7 ай бұрын
I would prefer you wrote the explanation while writing the code because you did not show what happens when there is a carry i.e. when it does not equal 0 in the previous explanation. The while loop condition says while carry is not 0 so now I am confused if the carry is a single digit. Edit: In fact, I found from chatgpt that 6 + 6 does have a carry but you reversed the operations so that confused me.
@athenkosimamfengu82598 ай бұрын
You just got yourself a new follower. What a beautiful beautiful explanation, wow
@LeetCodeUniversity8 ай бұрын
I really appreciate that!!
@Well23888 ай бұрын
So straightforward and easy to understand!Thanks a lot!
@suiryakumaran20349 ай бұрын
Great Explanation. Thank you so much.
@lakhanshanker61059 ай бұрын
Can we do product of all the elements of the array and divide it by the nums[i] ?
@me-giridhar9 ай бұрын
great!!!!!!!!!!
@mirriammaina686010 ай бұрын
Isn't time complextity worst case scenario? Worst case for this code is 2 loops for each num without a sequence since we always start at num + 0. I don't understand how this is O(n) time complexity
@162sujiths411 ай бұрын
Short and crisp 👏
@LeetCodeUniversity11 ай бұрын
Thank you!
@lobvida763011 ай бұрын
great video. amazing detail in the demonstration
@LeetCodeUniversity11 ай бұрын
Thank you!
@lobofloyed11 ай бұрын
Good explaination. I do wish you had continued and completed all 75 questions.
@observer861 Жыл бұрын
one of the rare videos where the instructor not only is good at solving but also, and more importantly in this case, explaining the solution
@LeetCodeUniversity Жыл бұрын
I really appreciate your kind words!
@observer861 Жыл бұрын
@@LeetCodeUniversity i wish you could do all 150 top interview questions ;)
@LeetCodeUniversity Жыл бұрын
@@observer861I have to get back to it for sure!
@sudhareddy14 ай бұрын
@@LeetCodeUniversity +1 looking for top 15o interview questions
@hoang640 Жыл бұрын
Thank you for very well explaination
@LeetCodeUniversity Жыл бұрын
Thank you!
@shobhanathsharma2113 Жыл бұрын
Very simple and intuitive explanation. Really appreciate it
@LeetCodeUniversity Жыл бұрын
Thank you!
@wajihakhan8618 Жыл бұрын
why you used while loop in line 11 can you explain this?
@bobzero3727 Жыл бұрын
That was great
@LeetCodeUniversity Жыл бұрын
Thank you!
@nivealokhande2153 Жыл бұрын
Thanks for such an awesome explanation
@LeetCodeUniversity Жыл бұрын
You are very welcome my friend!
@codeforfreedom Жыл бұрын
Brother, thank you so much! That's the most clear explanation I've seen so far searching for XOR understanding in youtube. Very much appreciated.
@LeetCodeUniversity Жыл бұрын
I really appreciate that! Thank you 🙏
@sethuprathapan4388 Жыл бұрын
there is a loop present , so how its become constant time complexity? can u please clarify my doubt?
@udaypandey565911 ай бұрын
because this loop will always do operation for 32 times. so here 32 is fixed , so if some thing is fixed we say it constant time
@melanieprevot4926 Жыл бұрын
Nice approach ! Thank you for sharing.
@LeetCodeUniversity Жыл бұрын
You are very welcome!
@ajaykumar-yk7to Жыл бұрын
sir very good explanation really. if they have have like[1,1,2,2,3,4] what the output sir they are two single numbers there here
@anuradhae9146 Жыл бұрын
can you please do th Pascal's Triangle II-119
@anuradhae9146 Жыл бұрын
This is the best code I could find. I really like the way you explain and how to reach solution. Keep it up! thanks lot!!