There is an integer array of length n that represents a permutation in the range [0,n−1].
Let's split an array into some number of chunks (partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.
Find the largest number of chunks we can make to sort the array.
The first line contains the size of array n(n≤105). The second line contains n integers - a permutation in the range [0,n−1].
Print the largest number of chunks we can make to sort the array.