Paralaxiom Interview Question

problem based on string. (easy level)