Ingenuity Gaming interview question

Coding question on string data structure.