Your question is Swap String Prefix In Place. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Fiverr may need to rotate a mutable character buffer used for displaying marketplace text. Given a sequence of characters chars and an integer n, move the first n characters to the end while preserving the order of both segments.
The operation must be performed in place, using O(N) time and O(1) auxiliary space. Since Python strings are immutable, chars is provided as a list of single-character strings. Modify and return that same list.
chars, a list of characters, and n, an integer satisfying 0 <= n <= len(chars).chars list after a left rotation by n positions.def rotate_label(chars, n):