Пікірлер
@iitgupta2010
@iitgupta2010 10 күн бұрын
Wonderful
@nuha0232
@nuha0232 10 күн бұрын
you are the best
@user-ml7bp3mf4n
@user-ml7bp3mf4n 16 күн бұрын
Thank you SO MUCH for your video! This problem made me stop learning for two weeks and with your video I have solved it with the first try!
@tpsspace7397
@tpsspace7397 16 күн бұрын
feel like this was little more complicated then it needed to be
@sproutboot
@sproutboot 18 күн бұрын
very good explanation 5:46 this is where i didn't get it. im glad i found this video
@GradStudentTutorials
@GradStudentTutorials 25 күн бұрын
Truly the best and most intuitive explanation of joins that I've seen. Everyone just stops at the venn diagrams...which means they probably don't fully understand it themselves haha
@harinathamasa9354
@harinathamasa9354 Ай бұрын
It would be nice if you would have explained your reserve logic a bit better with an example...
@OriAbulafia
@OriAbulafia Ай бұрын
bla bla
@onionsandwich
@onionsandwich Ай бұрын
Sensational.
@vishalialahappan9069
@vishalialahappan9069 Ай бұрын
Elegant resolve!
@jabedhasan21
@jabedhasan21 Ай бұрын
Excellent explanation, neat and clean code, Subscribed. Thank you so much.
@great1985rocker
@great1985rocker Ай бұрын
Hello Eric. The logic is good, but what happens when both the pointers are at the same value? Ideally we should be looking down from each side and move to a highest next tower. But that isn’t covered in this logic
@jasonchen8566
@jasonchen8566 Ай бұрын
// base case if (s == null || s.equals("")) return true; String right = (i == n)? "": s.substring(i,n);
@adilsaju
@adilsaju Ай бұрын
Amazing!
@pro_pranay
@pro_pranay Ай бұрын
Hash set?
@johnkim7783
@johnkim7783 Ай бұрын
very nice explanation !
@jasonchen8566
@jasonchen8566 Ай бұрын
not need to add => while (!stack.isEmpty()) { Integer topIndex = stack.pop(); map[topIndex] = 0; } since initial map array are initialized to all zero.
@jasonchen8566
@jasonchen8566 2 ай бұрын
excellent!
@anirudhakyathsandra1066
@anirudhakyathsandra1066 2 ай бұрын
Good solution, could be a little cleaner in terms of the if statements and that base case isn't required: class Solution { public void moveZeroes(int[] nums) { int left = 0; int right = 1; while(right < nums.length){ if(nums[left] == 0){ if(nums[right] !=0){ int temp = nums[left]; nums[left] = nums[right]; nums[right] = temp; } else{ right++; } } else{ left++; right++; } } } }
@amol_
@amol_ 2 ай бұрын
I this code will not work, incase of duplicate as during shrink operation you will never know the element which we are removing is it same max or we have duplicate also in windw. storing index is make sense
@SamarAshrafii
@SamarAshrafii 2 күн бұрын
No, it is working. I check it and it is actually easier than to keep indexes. Thanks for this video. You explained very well.
@bhuvanma7770
@bhuvanma7770 2 ай бұрын
Hey Eric, can you please make a video for leet code problem 643.
@divyshikha5488
@divyshikha5488 2 ай бұрын
What is the changed time complexity after using min heap?
@Shashwat73557
@Shashwat73557 2 ай бұрын
at 7th line return new int[ ] { l+1; r+1},,, why l+1. why not just l as we want index, l+1 means 1 index more.
@funter6980
@funter6980 24 күн бұрын
thats exactly my question too, maybe leetcode updated the question of two sum because its excepting the answer as [1,2] for when target is 9 while its actual indexs are [0,1].
@Shashwat73557
@Shashwat73557 23 күн бұрын
@@funter6980 right.
@WalaMohammed
@WalaMohammed 2 ай бұрын
in practice four time 29:42 why it's a/b i think it's O(a-(b+1))((
@user-iq3ey7fc3l
@user-iq3ey7fc3l 2 ай бұрын
Thank you, good solution
@user-iq3ey7fc3l
@user-iq3ey7fc3l 2 ай бұрын
But now, this method is time-exceeded in Leetcode.
@ivanchl
@ivanchl 3 ай бұрын
Excellent. Thank you!!
@ivanchl
@ivanchl 3 ай бұрын
Best explanation on the planet!
@aryangurung3401
@aryangurung3401 3 ай бұрын
this video is a gem. thank you so much
@techsavy5669
@techsavy5669 3 ай бұрын
Time complexity !?
@BinodKumar-be3ue
@BinodKumar-be3ue 3 ай бұрын
Great explanation
@FeelsLike4kingMatrix
@FeelsLike4kingMatrix 3 ай бұрын
You don't need Math. min here, just use left or right index, that's it. The rest is cool, thanks!
@sunisshining1
@sunisshining1 3 ай бұрын
public double findMedian() { if(size%2!=0) return maxheap.size() > minheap.size() ? (double) maxheap.peek() : (double) minheap.peek(); return (maxheap.peek()+ minheap.peek()) / 2.0; }
@archit5910
@archit5910 3 ай бұрын
Thank you so much
@go_lang_thang
@go_lang_thang 3 ай бұрын
func twoSum(numbers []int, target int) []int { var result []int l := 0 r := len(numbers) - 1 for r > l { if numbers[l]+numbers[r] == target { result = append(result, l+1) result = append(result, r+1) return result } else if numbers[l]+numbers[r] > target { r-- } else { l++ } } return result }
@chisomedoka5651
@chisomedoka5651 4 ай бұрын
is there a playlist for dfs?
@radovansurlak7445
@radovansurlak7445 4 ай бұрын
thank you!
@Smile880223
@Smile880223 4 ай бұрын
I think the reason we don't have to decrease the mostFreq is because mostFreq only affects our answer when it is larger than the previously largest mostFreq?
@bipinkarki6663
@bipinkarki6663 4 ай бұрын
Thank you sir this video made my day
@aaronelmquist8607
@aaronelmquist8607 4 ай бұрын
Great solution.
@Rob-J-BJJ
@Rob-J-BJJ 4 ай бұрын
I have to revise this videos bc I've been lacking
@Sranju23
@Sranju23 4 ай бұрын
damn i had no idea there exist stack.toArray() method...
@JerryHou1985
@JerryHou1985 5 ай бұрын
Set would also be log(n) where n is avg number of timestamps for a key, because inserting a new key into treeMap requires sorting that key ascendingly among existing keys
@0xVantwoutMaarten
@0xVantwoutMaarten 5 ай бұрын
I counted the word basically, you basically said 'basically', basically 500 times
@EmmanuelAgyapong-jn6ue
@EmmanuelAgyapong-jn6ue 5 ай бұрын
Thank you so much, bro!
@horcruxone
@horcruxone 5 ай бұрын
Great work! Thanks!
@dhirajsonawane3720
@dhirajsonawane3720 5 ай бұрын
Why are you starting loop from 1?
@Yuser-zv1of
@Yuser-zv1of 5 ай бұрын
what kind of drawer tool do you use? is it for macos?
@chrisb3902
@chrisb3902 5 ай бұрын
Great video!
@mounikathalla3440
@mounikathalla3440 5 ай бұрын
best answer Eric, thank you so much
@abhisheksachdeva3559
@abhisheksachdeva3559 5 ай бұрын
what if the target is equal to the sum of 3 elements of the array instead of 2 elements