Domanda di colloquio di Posidex Technologies

Sorting array and Pattern like this 1 12 123 1234 12345 and swapping two numbers without using 3rd variable