Тёмный
Algo Engine
Algo Engine
Algo Engine
Подписаться
A channel dedicated to providing clear, straightforward explanations and visualizations of topics in algorithms, programming, and computer science
LeetCode 49: Group Anagrams | Sort and Hash
4:56
2 месяца назад
LeetCode #136: Single Number | Bitwise XOR
5:47
5 месяцев назад
LeetCode #66: Plus One | Beginner Level
3:21
6 месяцев назад
LeetCode #322: Coin Change | Dynamic Programming
19:25
10 месяцев назад
LeetCode #69: Sqrt(x) | Binary Search
6:38
10 месяцев назад
LeetCode #207: Course Schedule | Topological Sort
12:07
11 месяцев назад
LeetCode #7: Reverse Integer
11:06
Год назад
LeetCode #6: Zigzag Conversion
7:18
Год назад
Комментарии
@ShahriyarRzayev
@ShahriyarRzayev 4 дня назад
amazing, simple and clean) thanks for sharing
@Ema97PF
@Ema97PF 4 дня назад
GOAT! I love everything about this video. The beauty of the opening screen is pure gold!
@Og_Uzok_
@Og_Uzok_ 9 дней назад
Ты огромный молодец, спасибо тебе!
@anupam5028
@anupam5028 11 дней назад
Plz carry on sir
@cruzorblade
@cruzorblade 13 дней назад
Great video. Explanations are so CLEAR... Wish you more subscribers and good contents 🎉
@amartyagupta9242
@amartyagupta9242 14 дней назад
WOW
@SouravKumar-qf2yp
@SouravKumar-qf2yp 17 дней назад
I hope your channel grows man, your videos help out a lot
@SindhuBuggana
@SindhuBuggana 17 дней назад
hey so can u make more vids coz my dumb brain decided to understand only the way u r explaining so u r my only chance !!!! make more more n more vids
@RamPageMMA
@RamPageMMA 18 дней назад
As usual, amazing animation work. I was initially really confused about the "start - 1" logic but after few hours of scratching my head, now it makes sense as it is used to find the beginning of a sequence. Thank you.
@adnansayed9870
@adnansayed9870 18 дней назад
The first method is actually incorrect! It will only work for some of the roman strings but not for all. For example : Lets say the string is ILM or VDM. Using the first method, the output would be 949 and 495 respectively. But the correct answer here would be 1051 and 1505. This is because it does not consider the 6 cases that are mentioned, it just checks for the greater number to compare. Although the seond method is actually correct. Please correct me if I am wrong. Appreciate your help @AlgoEngine
@AlgoEngine
@AlgoEngine 18 дней назад
Your example is correct, but in the LeetCode problem description, one of the given constraints is "It is guaranteed that s is a valid Roman numeral". In the Roman numeral system, the 6 cases mentioned are the *only* cases where a smaller number is allowed to precede a larger number, so ILM and VDM are *not* valid Roman numerals and would never be an input (there would also be no "correct answer"). To make them valid, you would need to write them as MLI and MDV. So because of that constraint, we don't need to worry about the scenario you gave, but I agree that if that constraint *wasn't* given, then we would have to implement error checking.
@antisocialgr1077
@antisocialgr1077 19 дней назад
I freaking love Ur channel. You give answer to all leet code questions
@SindhuBuggana
@SindhuBuggana 19 дней назад
okay whoever u are, thank you and plz make more videos
@RamPageMMA
@RamPageMMA 20 дней назад
Every time I think about your videos and your visual explantations, it makes me smile and want to solve more leetcode problems. Thanks for your effort in creating these amazing animations. Thank you for your hard work; it truly makes a difference.
@AlgoEngine
@AlgoEngine 19 дней назад
Thank you for supporting the channel! I'm really glad you like the videos - more are on the way!
@RamPageMMA
@RamPageMMA 20 дней назад
Million likes!!!!! man your videos are top notch quality. I hope you keep up this amazing work. 👍👍👍👍👍
@RamPageMMA
@RamPageMMA 21 день назад
Whoa… nice explanation!! Probably the cleanest explanation I’ve seen so far !!! Thank you. Please continue making more algo animations like these!!!
@RakeshRakesh-sm9dy
@RakeshRakesh-sm9dy 23 дня назад
thanks for helping me with you detailed solution
@sierraobi311
@sierraobi311 23 дня назад
I really enjoy your approach to video because each step is accompanied by an illustration. I can't wait to see more videos from you.
@dmitrypatriarkh9757
@dmitrypatriarkh9757 26 дней назад
Who adapting this for typescript and still gets error, check if you're correctly sorting array in the start
@jehovahshabba
@jehovahshabba 28 дней назад
Thanks Algo Engine! I'm on Day 2 of Python and feeling more confident thanks to your crash course - appreciate the guidance!😅
@trueyezerihun290
@trueyezerihun290 29 дней назад
Your the best! Great video.
@giriNITT
@giriNITT Месяц назад
Such crisp and neat video.
@kaeshur_koder
@kaeshur_koder Месяц назад
solved it with just 1 while loop def count_last_word_len(s): total = 0 last_space = True i = len(s) - 1 while i>=0: if (s[i] == ' ' and (last_space == True)): i-=1 elif(s[i] != ' '): last_space = False total+=1 i-=1 else: break return total print(count_last_word_len(" fly me to the moon "))
@guruprasaad4850
@guruprasaad4850 Месяц назад
class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: i = 0 length = len(nums) j = length - 1 left = list([1]);right = list([1]) for i in range(length-1): left.append( left[i] * nums[i] ) right.append( right[i] * nums[j] ) # backwards j -= 1 right.reverse() out = [ i * j for i, j in zip(left, right) ] return out
@karthikknavalli7472
@karthikknavalli7472 Месяц назад
bro till now in my life i followed neetcode solution,today i was not satisfied for his solution and hopping to drop this problem but by chance leetcode recommended your solution and i am totally astonished by your explaination and you are doing great work brother keep it up ❤❤
@Joshie-z8h
@Joshie-z8h Месяц назад
More videos please!! These are awesome. Thanks!
@anupam5028
@anupam5028 Месяц назад
sir try complete as many as you can . your super star while explaining. most underrated
@RISHABH-VERMA
@RISHABH-VERMA Месяц назад
Nice Explanation
@JayLim-bn9fh
@JayLim-bn9fh Месяц назад
thans yyou are the goat!
@AdityaSingh-nn2cd
@AdityaSingh-nn2cd Месяц назад
Great Explanation and very clear and understanding visualization , Thanks for helping and keep going ;)
@Wakser_4eq
@Wakser_4eq Месяц назад
Thanks!
@ypsingh199
@ypsingh199 Месяц назад
Can't we just append the newInterval to intervals and sort it. Theres no restriction limiting us to do that. After sorting we can apply merge interval algorithm which merges overlapping intervals.
@suvidhatandale6363
@suvidhatandale6363 Месяц назад
as a bigneer in python development i don't understand how did you access l1.val , l2.val and l1.next ,l2.next . please help me to understand it. I am getting AttributeError: 'list' object has no attribute 'val' error on my system.
@ismaelmehdid
@ismaelmehdid Месяц назад
very good explanation thanks!
@Manwong013
@Manwong013 Месяц назад
I love your solution, most easy and simple for the code. However, the test case is num1 = [2,7,11,15,3,6], target1 = 9, it will return [0,1], not [0, 1, 4, 5]
@sanmeshdesai7688
@sanmeshdesai7688 Месяц назад
Simple and clear explanation.
@evelyntromp789
@evelyntromp789 2 месяца назад
Amazing, thank you!!
@araneuskyuro
@araneuskyuro 2 месяца назад
Great explanation! Thank you
@cocotv1519
@cocotv1519 2 месяца назад
Your explanation is really good but when u fill up the left and right, ur red line of box is not easy to understand. Instead of that, just say multiply every left side or multiply every right side elements. Not like one by one. For example, when we calculate every left side of 5, say 2*3*4. And I think until 4:12 mins are enough to understand this question. Thank you for your explanation.
@weiwang9622
@weiwang9622 2 месяца назад
Is it possible to solve by: mid = left + right) / 2; if ((mid * mid <= x) { left = mid; } else if (mid * mid >= x) { right = mid; left = 0; } This yields results like x=9, left = 2.99999... right = 3.00001 but there is no way to decide if the final return is 2 or 3 because it infinitely closes to the actual value but how far left to the exact answer VS right to the exact answer cannot be decided. Is it possible to build a solution based on above logic? Below is the return condition I have: if (left * left < x && right * right > x && right - left <= 0.01) { return (int) Math.floor(right); } which does not work no matter how small the epsilon value is.
@LMGaming0
@LMGaming0 2 месяца назад
Amazing solution!
@MrMaiio123
@MrMaiio123 2 месяца назад
Thanks so much!
@chris_ez
@chris_ez 2 месяца назад
My brain just died i have no knowledge of math since i didn't listen when i was in highschool, any tips to begin?
@AlgoEngine
@AlgoEngine 2 месяца назад
Start with learning/reviewing all the basic algorithms and data structures and understanding their time and space complexities. After you have the basics down, the best way to learn is to practice! I'd recommend setting aside 20-30 min for each problem (depends on how much time you have), and if you don't get it by then, just look at the solution but make sure you understand it. Then after a few days, revisit the problem and try to solve it without looking at the solution.
@ypsingh199
@ypsingh199 2 месяца назад
a different approach I came up with, since we know there are specific exception conditions we can add them to dict itself. Seems to work! dict= { 'I' : 1, 'V' : 5, 'X' : 10, 'L' : 50, 'C' : 100, 'D' : 500, 'M' : 1000, 'IV' : 4, 'IX' : 9, 'XL' : 40, 'XC' : 90, 'CD' :400, 'CM' :900 } res=0 i=0 #index while (i< len(s)): if i != len(s)-1 and \ s[i] + s[i+1] in ['IV','IX','XL','XC','CD','CM']: res+=dict[s[i]+ s[i+1]] i+=1 #skip next character since we found the exception pair elif s[i] in dict: res+=dict[s[i]] i+=1 return res
@nihalbhamrah4726
@nihalbhamrah4726 2 месяца назад
great explanation i knew what way to think but didnt know how to implement it
@pvic6959
@pvic6959 2 месяца назад
oh lol. i saw this video, thought id solve it before watching . this exactly how i did it. i think this would be the most common solution i guess The ohnly addition I would say. dicts have a `get` function that can return a default. You can do ``` my_list = group.get(sorted_word, []) my_list.append(word) my_list[sorted_word] = my_list ```` if sorted_word is not seen so far, it will return an empty list as default
@v0nnyboy
@v0nnyboy 2 месяца назад
This is an O( N * M log M ) solution , where N is the number of strings and M is the length of a single string . You can do better . Avoid sorting and create an array of size 26 , every string will have a unique signature . Mapping using that concept will lead to the solution to be O ( N * M ) , with 26 * O ( N * M ) space Also, using a defaultdict( list) datastructure is python can make it's implementation simpler
@dom6330
@dom6330 2 месяца назад
Thank you!
@KiproCoder
@KiproCoder 2 месяца назад
Hey bro nice video, I did this one by myself, and I was surprised to see that my approach was so similar to a professional's!
@himanshu_27tt
@himanshu_27tt 2 месяца назад
this is the hardest algorithm that i have ever seen
@ganeshjaggineni4097
@ganeshjaggineni4097 2 месяца назад
NICE SUPER EXCELLENT MOTIVATED