Thank you very much for your explanation! I struggled for several hours to understand the related article in the Leetcode editorial but it was in vain. Then I found your video and got the idea after the first watch. So simple and clear explanation!
@@jawwadakhter5261 th-cam.com/video/WzT6wxzYG_k/w-d-xo.html here is the link for recursion problems. You can find step by step introduction of techniques to solve recursive problems in this playlist. Hope this helps!
you have written hight instead od right and ur code accepted wow i dont know how it happended but i should give u all right code class Solution { public int smallestDistancePair(int[] nums, int k) { Arrays.sort(nums); int left=0; int right=nums[nums.length-1]-nums[0]; while(left=k); } } btw explanation was relly appreciating
first: you calculated 'mid' wrong in the example second: Please try to give your own explanation instead of just copying and explaining code taken from discussion
Because left is the smallest k that satisfies our condition function. I have used the same template to solve all binary search problem, and you can check that template here, th-cam.com/video/g36R3EYFFvE/w-d-xo.html.
Thank you very much for your explanation! I struggled for several hours to understand the related article in the Leetcode editorial but it was in vain. Then I found your video and got the idea after the first watch. So simple and clear explanation!
You made a mistake at 6:34, it should be 7- 9 and the mid is 8
This is what an algorithm walk is called .....XD. Really Nice
Thanks a lot!!
@@CodersCamp Can you make more tutorials on recursion. I am having trouble in forming recursion logic
@@jawwadakhter5261 th-cam.com/video/WzT6wxzYG_k/w-d-xo.html here is the link for recursion problems. You can find step by step introduction of techniques to solve recursive problems in this playlist. Hope this helps!
you have written hight instead od right and ur code accepted wow i dont know how it happended but i should give u all right code class Solution {
public int smallestDistancePair(int[] nums, int k) {
Arrays.sort(nums);
int left=0;
int right=nums[nums.length-1]-nums[0];
while(left=k);
}
}
btw explanation was relly appreciating
Please keep making more leetcode videos!
NICE SUPER EXCELLENT MOTIVATED
Thanks a lot
Thankyou sor much for this video👍, your explanation is superb 😀
Thank you @Rekha Kumari
Thank you so much ma'am!
first: you calculated 'mid' wrong in the example
second: Please try to give your own explanation instead of just copying and explaining code taken from discussion
Great video!!!
Thank you thank you!
Clear explanation , thanku so much
Thank you!!! Happy Learning!
Subscribed!
Why return left ?
Because left is the smallest k that satisfies our condition function. I have used the same template to solve all binary search problem, and you can check that template here, th-cam.com/video/g36R3EYFFvE/w-d-xo.html.
sunar explanation