Microsoft interview question

Programming question on strings