← Pointer Manipulation
Pointer Manipulation Target: 10s
In-place segment reversal is the building block for rotate-array and next-permutation.
# Reverse a[l:r+1] in-place while l < r: a[l], a[r] = a[r], a[l] l += 1; r -= 1
Type it from memory. Go.