PAIRS OF SONGS DIVISIBLE BY 60 | LEETCODE # 1010 | PYTHON SOLUTION

preview_player
Показать описание
In this video we are solving a popular Amazon interview question: Pairs of Songs Divisible by 60. This problem follows a familiar pattern with Leetcode questions where we maintain a dictionary to keep track of elements we've seen before that might help with the item we are currently processing.

Here we're looking for songs that would add up with the current song to make a total song duration divisible by 60. Stay tuned to find out how to solve this problem.

If you enjoyed this video and would like to see more content like this, then please subscribe to my channel and help me grow!
Рекомендации по теме
Комментарии
Автор

Great video and explanation!!

I find it more intuitive in line 8 for viewers if you wrote this instead:

if (song_length % 60 == 0):
pairs += duration_dict[0]

Small difference but I find it more readable. Thanks again! :)

shamitbhatia