Strings
Task: Reverse this string in place
What you are watching
A string is a sequence of characters with indexes, which means every technique that works on an array of numbers works on it unchanged. Reversing REVERSE in place uses two pointers, one at each end, swapping the characters they point at and stepping inwards until they meet. Seven characters means the pointers land on the same middle character rather than crossing between two, and that character stays exactly where it is - the loop stops while l is still less than r is false.