n*lon(n) easy solution | 4 line logic | sorting
```\nint maxChunksToSorted(vector& v) \n    {\n        vector v1=v;\n\t\t\n        sort(v1.begin(),v1.end());\n\t\t\n        int n=v.size(),i,j,ans=0;\n\t\t//su
```\nint maxChunksToSorted(vector<int>& v) \n    {\n        vector<int> v1=v;\n\t\t\n        sort(v1.begin(),v1.end());\n\t\t\n        int n=v.size(),i,j,ans=0;\n\t\t//sum1 stores sum of original array while sum2 stores sum of sorted array\n        long long sum1=0,sum2=0;\n        for(i=0;i<n;i++)\n        {\n            sum1+=v[i];\n            sum2+=v1[i];\n            if(sum1==sum2)\n                ans++;\n        }\n        return ans;\n    }
['C', 'Sorting', 'C++']