[C++] multiset
\nclass Solution {\npublic:\n    int maxChunksToSorted(vector<int>& a) {\n        int chunks = 0;\n        multiset<int> cur;\n        multiset<int> expect;\n  
```\nclass Solution {\npublic:\n    int maxChunksToSorted(vector<int>& a) {\n        int chunks = 0;\n        multiset<int> cur;\n        multiset<int> expect;\n        vector<int> sorted = a;\n        sort(sorted.begin(), sorted.end());\n        for (int i = 0; i < a.size(); i++) {\n            expect.insert(sorted[i]);\n            cur.insert(a[i]);\n            if (cur == expect) chunks++;\n        }\n        return chunks;\n    }\n};\n```
[]