Merge Sorted Array - LeetCode 88 - Java

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

LeetCode University

LeetCode University

Күн бұрын

Пікірлер: 42
@observer861
@observer861 11 ай бұрын
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 11 ай бұрын
I really appreciate your kind words!
@observer861
@observer861 11 ай бұрын
@@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 3 ай бұрын
@@LeetCodeUniversity +1 looking for top 15o interview questions
@athenkosimamfengu8259
@athenkosimamfengu8259 7 ай бұрын
You just got yourself a new follower. What a beautiful beautiful explanation, wow
@LeetCodeUniversity
@LeetCodeUniversity 7 ай бұрын
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!
@notjohnAtall
@notjohnAtall 2 жыл бұрын
This is really nice. A refreshing approach and good explanations. Subscribed
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you for the kind words!
@RohanKumar-nx2ry
@RohanKumar-nx2ry Ай бұрын
this is what i expect from my teacher anyways you teach really good bro😀
@LeetCodeUniversity
@LeetCodeUniversity Ай бұрын
Thank you! I absolutely love to teach, glad you found it helpful!
@Emanuel-yb3qk
@Emanuel-yb3qk 16 күн бұрын
Thanks for the video.
@LeetCodeUniversity
@LeetCodeUniversity 14 күн бұрын
My pleasure!
@melanieprevot4926
@melanieprevot4926 Жыл бұрын
Nice approach ! Thank you for sharing.
@LeetCodeUniversity
@LeetCodeUniversity Жыл бұрын
You are very welcome!
@chadsmith71
@chadsmith71 Ай бұрын
very good. I am now a subscriber. great work.
@LeetCodeUniversity
@LeetCodeUniversity Ай бұрын
Appreciate that!
@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!
@dianakyrychyk3731
@dianakyrychyk3731 Жыл бұрын
Thank you for the great explanation!
@LeetCodeUniversity
@LeetCodeUniversity Жыл бұрын
Diana, you are very welcome!
@sysybaba420
@sysybaba420 2 жыл бұрын
Love your explanation!
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you, I am so glad I helped!
@suiryakumaran2034
@suiryakumaran2034 8 ай бұрын
Great Explanation. Thank you so much.
@_4p_
@_4p_ Ай бұрын
Thanks
@nikeshsingh2081
@nikeshsingh2081 2 жыл бұрын
Great explanation..
@LeetCodeUniversity
@LeetCodeUniversity 2 жыл бұрын
Thank you!
@axlash
@axlash Жыл бұрын
thank you 😊😊😊😊
@LeetCodeUniversity
@LeetCodeUniversity Жыл бұрын
You are very welcome!
@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--; } } } }
@flyguynoaholdksa5461
@flyguynoaholdksa5461 2 жыл бұрын
Nice
@AanchalSharma-e4e
@AanchalSharma-e4e 2 ай бұрын
please upload more questions
@LeetCodeUniversity
@LeetCodeUniversity Ай бұрын
I will!
@swapnil72
@swapnil72 22 күн бұрын
I did not understand why use the second while loop?
@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 29 күн бұрын
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
Рет қаралды 227 М.
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4 МЛН
Motorbike Smashes Into Porsche! 😱
00:15
Caters Clips
Рет қаралды 16 МЛН
Colorful Pasta Painting for Fun Times! 🍝 🎨
00:29
La La Learn
Рет қаралды 308 МЛН
LEETCODE 88 (JAVASCRIPT) | MERGE SORTED ARRAY
9:43
Andy Gala
Рет қаралды 12 М.
Longest Consecutive Sequence - LeetCode 128 - Java
24:18
LeetCode University
Рет қаралды 1,4 М.
Merge Sorted Arrays Without Extra Space | 2 Optimal Solution
32:47
take U forward
Рет қаралды 209 М.
Merge Sorted Array - Leetcode 88 - Arrays & Strings (Python)
6:08
10 FORBIDDEN Sorting Algorithms
9:41
Ardens
Рет қаралды 913 М.
Product of Array Except Self - LeetCode 238 - Java
28:54
LeetCode University
Рет қаралды 2 М.
My Brain after 569 Leetcode Problems
7:50
NeetCode
Рет қаралды 2,7 МЛН
Remove Duplicates from Sorted Array - Leetcode 26 - Python
10:38
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4 МЛН