You have an array
Constraints
For all subtasks:
Input Specification
The first line contains a single integer
The second line contains
Output Specification
Output the minimum number of operations required to turn the array into a non-decreasing sequence.
Sample Input
Copy
5
10 7 8 3 4
Sample Output
Copy
3
Explanation for Sample Output
A possible final array could be
Comments