Pregunta de entrevista de LTM Limited

Coding based question of swapping