Leetcode - Candy (Python)

preview_player
Показать описание
June 2021 Leetcode Challenge
Leetcode - Candy #135
Difficulty: Hard
Рекомендации по теме
Комментарии
Автор

Great solution.
but, for the first pass, max() is not required I guess.

shankhashuvrosinha
Автор

The final sum() would incur a third iteration through the entire array so during the second for-loop, I summed up the values and saved that in a variable that I simply returned at the end. Still linear but O(2n) instead of O(3n)😃

davidmontes
Автор

I've noticed that in some of your solution videos, you don't talk about the time and space complexities, I feel doing so in all videos will be helpful.

sosanyaayonitemi
Автор

could you solve the skyline problem next ?
thanks :)
218. The Skyline Problem

raghavgurbaxani
welcome to shbcf.ru