Easy Solution here. using the concept of leftMax and RightMin to check
IntuitionApproachComplexity
Time complexity:

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

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int maxChunksToSorted(vector<int>& arr) {
        int n = arr.size();
        int ans = 1;
        vector<int> left(n,0);
        vector<int> right(n,0);
        left[0] = arr[0];
        right[n-1] = arr[n-1];

        for(int i = 1;i < n;i++){
            left[i] = max(left[i-1],arr[i]);
            right[n-i-1] = min(right[n-i],arr[n-i-1]);
        }

        for(int i = 0;i < n-1;i++){
            if(left[i] <= right[i+1]){
                ans++;
            }
        }
        return ans;
    }
};
```
['C++']