LeetCode 1010. Pairs of Songs with Total Durations Divisible by 60 [Coding Question Explained]

  Рет қаралды 7,846

Shiran Afergan

Shiran Afergan

Күн бұрын

In this video I explain the solution of an Amazon coding interview question “Pairs of Songs with Total Durations Divisible by 60” [LeetCode 1010].
You can find it here -
leetcode.com/p...
If there is a coding interview problem you would like me to cover, let me know in the comments.

Пікірлер: 45
@KaaiSpeaksHisMind
@KaaiSpeaksHisMind 3 жыл бұрын
I have solved many modular arithmetic problems before, but that visualization you drew just made me look at it from a whole new perspective that is very suitable to this problem. Thank you.
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
That’s awesome! Thanks for letting me know :)
@Davidvideo3
@Davidvideo3 3 жыл бұрын
really the best explanation channel there is and i've been in the leetcoding game for 5 years now. good to have u back
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
Thank you David 😊😊
@shreyassrinivasan8550
@shreyassrinivasan8550 3 жыл бұрын
I watched one video then subscribed to you! REALLY good explanation and quality of videos! Thank you!!
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
That’s awesome! Thank you 😊
@swagatzeher
@swagatzeher 3 жыл бұрын
Best ever explanation to the problem.
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
Thanks :)
@JameS00989
@JameS00989 Жыл бұрын
Best solution on internet 🎉 Thanks Shriran
@anirbandutta2266
@anirbandutta2266 11 күн бұрын
Like your style - thanks!
@RanjuRao
@RanjuRao Жыл бұрын
Thank you for crisp and clear explanation !
@cryptojeff3993
@cryptojeff3993 3 жыл бұрын
This is super clear! Thank you very much!
@rishabhjain2404
@rishabhjain2404 6 ай бұрын
amazing, very well explained!
@DanielRodrigues-bx6lr
@DanielRodrigues-bx6lr Жыл бұрын
Very well explained, thanks! Small question for anyone still reading this: Is there any reason to go for an array/vector based solution instead of the hashmap solution like explained earlier on in the video? Both should work since they're essentially the same thing, I'm just a bit curious why the array version was chosen over the hashmap and if there are any edge cases to keep in mind if using the hashmap version
@abhimanyuambastha2595
@abhimanyuambastha2595 11 күн бұрын
hashmap should work fine. I guess the reason to use vector is probably cuz with a fixed size arrays, they are faster than hashmaps that sill have an average time lookup of O(1). They have overheads that might slow down the code. I'm not very well versed with the C++ language, but I used hashmap in Python and everything worked as expected
@user-uh3zr7mo4i
@user-uh3zr7mo4i 3 жыл бұрын
you are amazing!! start posting your solutions in leetcode discussions, that'll help you garner some views and subs. good luck and stay safe :)
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
Thanks! Good tip, I’ll do it :)
@nikhilamu
@nikhilamu 2 жыл бұрын
The visualisation was so helpful :) great explanation! Thanks
@SergeKnysh
@SergeKnysh 3 жыл бұрын
Amazing. Very clear explanation. Thanks
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
Thanks :)
@uptonogood300
@uptonogood300 3 жыл бұрын
A new video! Finally🥶
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
Haha 😂 hope you’ll like it
@kaminnadav
@kaminnadav 3 жыл бұрын
Great explanation. Thanks!
@wallaceobey6630
@wallaceobey6630 2 жыл бұрын
Just subscripted. This is really great! Plus you do it in C++. Thank you so much!!!
@ShiranAfergan
@ShiranAfergan 2 жыл бұрын
Finally! someone that likes C++ 😆😆 glad you enjoyed the video!
@wallaceobey6630
@wallaceobey6630 2 жыл бұрын
@@ShiranAfergan Yeahh It's so hard to find C++ LeetCode tutorials. Everyone does it in Python or Java. Thanks again!
@wallaceobey6630
@wallaceobey6630 2 жыл бұрын
@@ShiranAfergan For linked list problems do you use smart pointers? I was looking through the elements of programming interview book and saw they used it there.
@sahilattri2089
@sahilattri2089 2 жыл бұрын
Great video thanks a lot. It is really cool to scribble over browser with apple pencil.. Can you please tell how you did that?
@ShiranAfergan
@ShiranAfergan 2 жыл бұрын
Thanks! I’m not really writing on the browser. It’s a screenshot of the browser:) I use GoodNotes for that
@sahilattri2089
@sahilattri2089 2 жыл бұрын
@@ShiranAfergan must take lot of hardwork to switch between typing there and writing over screenshot and ofcourse the editing.. great work :)
@ShiranAfergan
@ShiranAfergan 2 жыл бұрын
Yeh the editing takes time, putting it all together 🙂 thanks!
@khadijahflowers5566
@khadijahflowers5566 5 ай бұрын
Why does it not work if we first compute the modulos and then do the complement check? Does doing it in place help us avoid duplicate counting?
@abhimanyuambastha2595
@abhimanyuambastha2595 11 күн бұрын
You would be double counting the numbers, try dividing the result by 2, that should be correct I think
@mangeshrane8933
@mangeshrane8933 2 жыл бұрын
Visualization made me subscribe to the channel :-)
@ShiranAfergan
@ShiranAfergan 2 жыл бұрын
😊🎊
@sixth_sense_working
@sixth_sense_working 2 жыл бұрын
vector are already assigned with value 0 when we determine the size
@ShiranAfergan
@ShiranAfergan 2 жыл бұрын
Yes it will use the default value of the element type. But still I like the explicit way :)
@MilindGupta
@MilindGupta 3 жыл бұрын
Hey why uploading after so long I missed those explanation
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
Haha had a busy few months. I’ll try to post more often now :)
@vinaykenguva362
@vinaykenguva362 3 жыл бұрын
Really too long wait.
@ShiranAfergan
@ShiranAfergan 3 жыл бұрын
I knowww i’ll try to post more often :)
@TheShislon
@TheShislon 3 жыл бұрын
נהדרת, אבל חייבת לעבוד על המבטא!
@Ak-in5cu
@Ak-in5cu 2 жыл бұрын
Talk little bit slow
@StfuSiriusly
@StfuSiriusly 2 жыл бұрын
you can slow down the video..
PAIRS OF SONGS DIVISIBLE BY 60 | LEETCODE # 1010 | PYTHON SOLUTION
15:36
Это было очень близко...
00:10
Аришнев
Рет қаралды 1,6 МЛН
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 289 М.
Кәсіпқой бокс | Жәнібек Әлімханұлы - Андрей Михайлович
48:57
Data Structures for Coding Interviews [In 10 Minutes]
10:40
Shiran Afergan
Рет қаралды 43 М.
Capacity Planning and Estimation | System Design for Beginners
16:38
Shiran Afergan
Рет қаралды 25 М.
Whiteboard Coding Interviews: 6 Steps to Solve Any Problem
15:18
Fullstack Academy
Рет қаралды 373 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 1,6 МЛН