@h4cktivist It means for every test case it will take o(MlogM), what you didn’t understand.
@pushkarmishra In what order(increasing/decreasing) should I sort them.
greater than m-i-1?? how did u know “m-i-1” would give the answer?