Solved LeetCode program · 546 of 1,000
#0769 · Max Chunks To Make Sorted
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.
Expected stdout
4