Jane Street Interview Question

a question on string