On top of that, one can use strings as a normal "sequenced container of characters" and just use <algorithm>s on them. This is one of my favorite ways to write concise code in those interview questions (e.g. "That's just a rotate, then a partition").