Could someone help me with the Intuition behind this solution?

Правка en1, от learningcurve_, 2023-01-02 17:26:14

I tried to think of ways to solve this problem, after not being able to think of a solution which I could reason about, I read the editorial and understood the binary search solution, but I don't understand why the greedy solution works.

Could someone help reason about the greedy solution?

Теги help, greedy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский learningcurve_ 2023-01-02 17:26:14 468 Initial revision (published)