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!
@tpsspace739716 күн бұрын
feel like this was little more complicated then it needed to be
@sproutboot18 күн бұрын
very good explanation 5:46 this is where i didn't get it. im glad i found this video
@GradStudentTutorials25 күн бұрын
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Ай бұрын
It would be nice if you would have explained your reserve logic a bit better with an example...
@OriAbulafiaАй бұрын
bla bla
@onionsandwichАй бұрын
Sensational.
@vishalialahappan9069Ай бұрын
Elegant resolve!
@jabedhasan21Ай бұрын
Excellent explanation, neat and clean code, Subscribed. Thank you so much.
@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Ай бұрын
// base case if (s == null || s.equals("")) return true; String right = (i == n)? "": s.substring(i,n);
@adilsajuАй бұрын
Amazing!
@pro_pranayАй бұрын
Hash set?
@johnkim7783Ай бұрын
very nice explanation !
@jasonchen8566Ай бұрын
not need to add => while (!stack.isEmpty()) { Integer topIndex = stack.pop(); map[topIndex] = 0; } since initial map array are initialized to all zero.
@jasonchen85662 ай бұрын
excellent!
@anirudhakyathsandra10662 ай бұрын
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_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
@SamarAshrafii2 күн бұрын
No, it is working. I check it and it is actually easier than to keep indexes. Thanks for this video. You explained very well.
@bhuvanma77702 ай бұрын
Hey Eric, can you please make a video for leet code problem 643.
@divyshikha54882 ай бұрын
What is the changed time complexity after using min heap?
@Shashwat735572 ай бұрын
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.
@funter698024 күн бұрын
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].
@Shashwat7355723 күн бұрын
@@funter6980 right.
@WalaMohammed2 ай бұрын
in practice four time 29:42 why it's a/b i think it's O(a-(b+1))((
@user-iq3ey7fc3l2 ай бұрын
Thank you, good solution
@user-iq3ey7fc3l2 ай бұрын
But now, this method is time-exceeded in Leetcode.
@ivanchl3 ай бұрын
Excellent. Thank you!!
@ivanchl3 ай бұрын
Best explanation on the planet!
@aryangurung34013 ай бұрын
this video is a gem. thank you so much
@techsavy56693 ай бұрын
Time complexity !?
@BinodKumar-be3ue3 ай бұрын
Great explanation
@FeelsLike4kingMatrix3 ай бұрын
You don't need Math. min here, just use left or right index, that's it. The rest is cool, thanks!
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 }
@chisomedoka56514 ай бұрын
is there a playlist for dfs?
@radovansurlak74454 ай бұрын
thank you!
@Smile8802234 ай бұрын
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?
@bipinkarki66634 ай бұрын
Thank you sir this video made my day
@aaronelmquist86074 ай бұрын
Great solution.
@Rob-J-BJJ4 ай бұрын
I have to revise this videos bc I've been lacking
@Sranju234 ай бұрын
damn i had no idea there exist stack.toArray() method...
@JerryHou19855 ай бұрын
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
@0xVantwoutMaarten5 ай бұрын
I counted the word basically, you basically said 'basically', basically 500 times
@EmmanuelAgyapong-jn6ue5 ай бұрын
Thank you so much, bro!
@horcruxone5 ай бұрын
Great work! Thanks!
@dhirajsonawane37205 ай бұрын
Why are you starting loop from 1?
@Yuser-zv1of5 ай бұрын
what kind of drawer tool do you use? is it for macos?
@chrisb39025 ай бұрын
Great video!
@mounikathalla34405 ай бұрын
best answer Eric, thank you so much
@abhisheksachdeva35595 ай бұрын
what if the target is equal to the sum of 3 elements of the array instead of 2 elements