Help with greedy problem

Revision en1, by aakarshmadhavan, 2018-07-02 02:14:50

Hello,

I find myself very bad at greedy-algorithms and greedy-problems. I have found an easy problem online I have not been succesful myself in solving:

Problem

I am not confident in how to get to this problem.

My current idea is to sort the array according to height, and if height is equal then according to k. But I am not sure where to go on from here. Any help is appreciated greatly.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aakarshmadhavan 2018-07-02 02:14:50 464 Initial revision (published)