2542. Maximum Subsequence Score (Leetcode Medium)

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

At 5:50 a heap queue is introduced. How do you bring up an idea to use the heap queue (or priority queue in case of java), and believe testing these combinations can prone other untested combinations?

There are C(n, k) cases and n could be 10^5. There is to much cases. So greedy algo is needed. The puzzle is why it works.

csmth
Автор

Was this the similar question you were thinking of? 1383. Maximum Performance of a Team

lostgoat
visit shbcf.ru