Pergunta de entrevista da empresa P\S\L Group

Swap the value of two variables without any third variable.

Resposta da entrevista

Sigiloso

9 de ago. de 2018

Imagine x=10 and Y=6. Compare which is bigger. Then iterate x-y=4 times adding one to small number and substracting one to the big number. So x-4=6 and y+4=10.