K CLOSEST POINTS TO ORIGIN | LEETCODE 973 | PYTHON SOLUTION
Автор: Cracking FAANG
Загружено: 2022-03-19
Просмотров: 3594
In this video we are solving a popular Amazon interview question involving heaps: K Closest Points to Origin.
This is a straightforward question but the heap set up is a bit tricky because we need to use a max heap to keep track of the K smallest elements. This is weird because we usually think of max heaps as storing the largest element so using it to keep track of the K smallest is a bit awkward at first but makes sense conceptually once you think about it.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: