Back to Teaching

The max-subarray toy

Pick the stretch of numbers with the biggest total, check it, then watch a computer find it in one pass.

2026

Kadane’s algorithm, found by hand before it is shown.

The max-subarray toy

Find the stretch of numbers with the biggest total. Tap where it starts, then where it ends.

Tap where your stretch starts.

The toy did not load. Reload the page to play.