01 · Question
We are given an array of letters, arr, and a length, n, which is a multiple of 3. The goal is to modify arr in place to move the prefix of length n/3 to the end and the suffix of length n/3 to the beginning.
Example:
- Input:
arr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'] - Output:
['G', 'H', 'I', 'D', 'E', 'F', 'A', 'B', 'C']