Tavant interview question

A coding question on strings