CSES — Concert Tickets....but harder?

Revision en1, by CantLoseNow, 2022-10-31 13:22:01

so i was solving this question from searching and sorting section of cses. it took me a hour to solve it through 2 pointers. But i was wondering what would be the approach to solve if the gondola can contain 3 children instead of 2. And what if the limit was 4 children? do these type of questions have some same approach? Can someone please help me???

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English CantLoseNow 2022-10-31 13:22:17 21
en1 English CantLoseNow 2022-10-31 13:22:01 429 Initial revision (published)