Given an array, find the maximum number of chunks you can partition it into so that concatenating the chunks produces the sorted array.
Assume arr is a permutation of the integers from 0 through n - 1. Return the maximum number of contiguous chunks. Each chunk may be sorted independently, and the chunks are then concatenated.
Function: def max_chunks_to_sorted(arr):
Input: A list of distinct integers. Output: An integer count.
def max_chunks_to_sorted(arr):