Sponsored
Use these hints if you're stuck. Try solving on your own first.
The first chunk can be found as the smallest k for which A[:k+1] == [0, 1, 2, ...k]; then we repeat this process.
Solve with full IDE support and test cases