The TransCompilator

Solved LeetCode program · 546 of 1,000

#0769 · Max Chunks To Make Sorted

Medium Array chunk-11.md

Original English source

The numbers is a list of 1, 0, 2, 3, and 4. The last is the last position of numbers. The chunks is 0. The high is 0.
For every spot from 0 to last.
If item spot of numbers is more than high, set high to item spot of numbers. If high is spot, add 1 to chunks.

Show chunks.

Open in Playground Browse all 1,000 problems

Expected stdout

4