How to Apply merge sort here?

I knew merge sorting,but didnt getting how to apply this here-> https://www.codechef.com/problems/EURON

Please Explain what actually problem demands?

@vivek96

The problem is about to find sigma(n) where n is the total number of numbers not following the ascending order.

1 Like

then we can check a[i] and a[i+1] and use counter?

Most probably…but constraints are 10^5,keep this in mind.

sorry but answers are different,you can check example,In editorial they are using merge sort…

Did you checked the setter’s solution.