Python 3   ||   2 lines,  accumulate   ||   T/S: 97% / 40%
Here\'s the plan:\nWe accumulate the sums of both arr and sorted(arr). A little thinking leads one to this conclusion: whenever the accumulated sums are equal, 
Here\'s the plan:\nWe accumulate the sums of both `arr` and `sorted(arr)`. A little thinking leads one to this conclusion: whenever the accumulated sums are equal, we can break off a chunk. Thus, the problem reduces to counting the number of instances in which the respectives accumulated sums are equal.\n\n(Yes, I know it could be a one-liner, but I\'m not just that guy.)\n```\nclass Solution:\n    def maxChunksToSorted(self, arr: List[int]) -> int:\n\n        acc = zip(accumulate(arr), accumulate(sorted(arr)))\n\n        return len(tuple(filter(lambda x: x[0] == x[1],acc)))\n```\n[https://leetcode.com/problems/max-chunks-to-make-sorted-ii/submissions/1150149800/](http://)\n\nI could be wrong, but I think that time complexity is *O*(*N*log*N*) and space complexity is *O*(*N*), in which *N* ~ `len(arr)`.
['Python3']