My test cases not passes

from my side, I think I’m applying correct logic but my code does not pass any test case

added comments for u to understand u need to apply greedy selection here

why we use sorting here

for the q assume
u have a photocopy shop
and u have got multiple set to print
each with start and end time given
at the end of the day u have to decide which all sets u will do so that maximum sets need to be printed

so u`ll do those which finish early right
( ie sort them by end timinig [ending first] so that u could start the next activity with closer end time)