Easy way to solve this problem, easy to understand for beginner
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
    Easy solution to solve this problem and easy to understand

# Approach
<!-- Describe your approach to solving the problem. -->
    I used another array as a index.

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(n)+function sort = o(nlogn)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(n)

# Code
```cpp []
class Solution {
public:
    int maxChunksToSorted(vector<int>& arr) {
        int cont=0;
        long long current = 0;
        vector<int> arr1;
        for(int i = 0 ; i < arr.size();i++)
        {
            arr1.push_back(arr[i]);
        }
        sort(arr1.begin(),arr1.end());
        for(int i = 0 ; i < arr.size();i++)
        {
           current+= arr[i]-arr1[i];
           cont+=(current==0);
        }
        return cont;
    }
};
```
['C++']