LinkedIn Interview Question

Question related to text manipulation