Ingenuity Gaming Interview Question

Coding question on string data structure.