# 769

class Solution:
    # a new chunk is form only if the current element is the max so far,
    # and it is where it is supposed to be 
    def max_chunks(self, nums):
        result = max_so_far = 0

        for i, num in enumerate(nums):
            max_so_far = max(max_so_far, num)
            if max_so_far == i:
                result += 1
        
        return result