[C++], 12ms, O(n) without sorting
\n    int maxChunksToSorted(vector<int>& arr) {\n        int n = arr.size();\n        \n        vector<int> rightMin(n+1); rightMin[n] = INT_MAX;\n        \n   
```\n    int maxChunksToSorted(vector<int>& arr) {\n        int n = arr.size();\n        \n        vector<int> rightMin(n+1); rightMin[n] = INT_MAX;\n        \n        for(int i=n-1;i>=0;i--) rightMin[i] = min(rightMin[i+1],arr[i]);\n        \n        int ans = 0, lmax = INT_MIN;\n        \n        for(int i=0;i<n;i++)\n        {\n            lmax = max(lmax, arr[i]);\n            if(lmax <= rightMin[i+1]) ans++;\n        }\n        return ans;\n    }\n```
['Array', 'C++']