Pregunta de entrevista de PTC

I was asked to implement "swap" function