04 Try it yourself Interactive
The same job, two ways, on the same list. Brute force re-scans the tail from every position. The monotonic stack scans once and pops. Watch the stack column on the right and the comparison counter at the bottom.