Hint required for this problem

how can i start thinking in this problem?

hi @gunvirmittal_9f1753c05330d09c do u know about sorting arrays using comparators? it will be done by this technique only