O(n) beats 100% precomputing.
Intuition
Array arr can seperate to 2 chunks arr1, arr2 only if data in arr1 < any data in arr2 
Approach
Precomputing calculate maxLeft and minRight of arr
Com
# Intuition
- Array `arr` can seperate to 2 chunks `arr1, arr2 only if data in arr1 < any data in arr2 `

# Approach
- Precomputing calculate `maxLeft` and `minRight` of `arr`
- Compare and choose the right index to seperate
    - `i == len(arr)-1` or `maxLeft[i] == minRight[i]` or `maxLeft[i] <= minRight[i+1] `

# Complexity
- Time complexity: O(n)

- Space complexity: O(n)

# Code
```golang []
func maxChunksToSorted(arr []int) int {
	maxLeft := make([]int, len(arr))
	maxLeft[0] = arr[0]
	for i := 1; i < len(arr); i++ {
		maxLeft[i] = max(maxLeft[i-1], arr[i])
	}
	minRight := make([]int, len(arr))
	minRight[len(arr)-1] = arr[len(arr)-1]
	for i := len(arr) - 2; i >= 0; i-- {
		minRight[i] = min(minRight[i+1], arr[i])
	}
	rs := 0
	for i := range maxLeft {
		if i == len(arr)-1 || maxLeft[i] == minRight[i] || maxLeft[i] <= minRight[i+1] {
			rs++
		}
	}
	return rs
}
```
['Go']