Pregunta de entrevista de Infosys

Programming question on strings and swapping