Mental Model
Find the next bigger arrangement of numbers by changing the smallest possible part of the array.
Analogy: Imagine you have a lock with digits. To get the next code, you try to increase the last digit. If it can't go higher, you move left to find a digit you can increase, then reset digits to the right to the smallest order.
Array: [1, 2, 3, 4, 5] Indexes: 0 1 2 3 4 We want to find the next bigger order by changing digits from right to left.