Arrays problem sorting game

i am not able to solve this problem.and the solution which is given is also written in c++.can u tell me how to proceed

Hey @Sumant123
Leave this question for now. Because in this question we need to make comparator