Merge Sorted Array - LeetCode 88 - Java

  Рет қаралды 10,469

LeetCode University

LeetCode University

Күн бұрын

Пікірлер: 42
@observer861
@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
@LeetCodeUniversity Жыл бұрын
I really appreciate your kind words!
@observer861
@observer861 Жыл бұрын
@@LeetCodeUniversity i wish you could do all 150 top interview questions ;)
@LeetCodeUniversity
@LeetCodeUniversity 11 ай бұрын
@@observer861I have to get back to it for sure!
@sudhareddy1
@sudhareddy1 4 ай бұрын
@@LeetCodeUniversity +1 looking for top 15o interview questions
@athenkosimamfengu8259
@athenkosimamfengu8259 8 ай бұрын
You just got yourself a new follower. What a beautiful beautiful explanation, wow
@LeetCodeUniversity
@LeetCodeUniversity 8 ай бұрын
I really appreciate that!!
@shashankvashishtha935
@shashankvashishtha935 2 жыл бұрын
Since i was searching this question for a better approach. thank you for this explanation.
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you very much my friend!
@RohanKumar-nx2ry
@RohanKumar-nx2ry 2 ай бұрын
this is what i expect from my teacher anyways you teach really good bro😀
@LeetCodeUniversity
@LeetCodeUniversity 2 ай бұрын
Thank you! I absolutely love to teach, glad you found it helpful!
@melanieprevot4926
@melanieprevot4926 Жыл бұрын
Nice approach ! Thank you for sharing.
@LeetCodeUniversity
@LeetCodeUniversity Жыл бұрын
You are very welcome!
@Emanuel-yb3qk
@Emanuel-yb3qk Ай бұрын
Thanks for the video.
@LeetCodeUniversity
@LeetCodeUniversity Ай бұрын
My pleasure!
@suggestaname1685
@suggestaname1685 2 жыл бұрын
Thank yo so much for this amazing explanation. Really really good!
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you so much, I am so glad You benefited from the video!
@notjohnAtall
@notjohnAtall 2 жыл бұрын
This is really nice. A refreshing approach and good explanations. Subscribed
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you for the kind words!
@dianakyrychyk3731
@dianakyrychyk3731 Жыл бұрын
Thank you for the great explanation!
@LeetCodeUniversity
@LeetCodeUniversity Жыл бұрын
Diana, you are very welcome!
@suiryakumaran2034
@suiryakumaran2034 8 ай бұрын
Great Explanation. Thank you so much.
@sysybaba420
@sysybaba420 2 жыл бұрын
Love your explanation!
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you, I am so glad I helped!
@chadsmith71
@chadsmith71 2 ай бұрын
very good. I am now a subscriber. great work.
@LeetCodeUniversity
@LeetCodeUniversity 2 ай бұрын
Appreciate that!
@_4p_
@_4p_ 2 ай бұрын
Thanks
@musamehdiyevv
@musamehdiyevv 5 ай бұрын
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--; } } } }
@nikeshsingh2081
@nikeshsingh2081 2 жыл бұрын
Great explanation..
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you!
@axlash
@axlash Жыл бұрын
thank you 😊😊😊😊
@LeetCodeUniversity
@LeetCodeUniversity Жыл бұрын
You are very welcome!
@swapnil72
@swapnil72 Ай бұрын
I did not understand why use the second while loop?
@flyguynoaholdksa5461
@flyguynoaholdksa5461 2 жыл бұрын
Nice
@AanchalSharma-e4e
@AanchalSharma-e4e 3 ай бұрын
please upload more questions
@LeetCodeUniversity
@LeetCodeUniversity 2 ай бұрын
I will!
@Jaffar87
@Jaffar87 2 жыл бұрын
are u going to do all leetcode questions
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
The plan is to do Blind 75 list and then do pattern based questions
@Jaffar87
@Jaffar87 2 жыл бұрын
Thanks it would be nice if you do all the leetcode questions
@kousthubganugapati7193
@kousthubganugapati7193 4 ай бұрын
will this work for every array
@LeetCodeUniversity
@LeetCodeUniversity Ай бұрын
For sure!
@alastairhewitt380
@alastairhewitt380 4 ай бұрын
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
Maximum Subarray - LeetCode 53 - Java | Kadane's Algorithm
18:21
LeetCode University
Рет қаралды 1,4 М.
Merge Sorted Array - Leetcode 88 - Python
10:18
NeetCode
Рет қаралды 234 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 149 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 21 МЛН
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 3,2 МЛН
LEETCODE 88 (JAVASCRIPT) | MERGE SORTED ARRAY
9:43
Andy Gala
Рет қаралды 12 М.
Merge Sorted Array - Leetcode 88 - Arrays & Strings (Python)
6:08
Remove Duplicates from Sorted Array
5:41
Kevin Naughton Jr.
Рет қаралды 76 М.
LeetCode Merge Two Sorted Lists Solution Explained - Java
4:03
Nick White
Рет қаралды 126 М.
Merge Sorted Arrays Without Extra Space | 2 Optimal Solution
32:47
take U forward
Рет қаралды 217 М.
Merge Sorted Array | Leet code 88 | Theory explained + Python code
16:12
Valid Sudoku - LeetCode 36 - Java
15:28
LeetCode University
Рет қаралды 4,5 М.
Valid Parentheses - LeetCode 20 - Java | Stack
19:17
LeetCode University
Рет қаралды 1 М.
Merge Sorted Array | Live Coding with Explanation | Leetcode - 88
4:50
Algorithms Made Easy
Рет қаралды 77 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 149 МЛН