Yandex interview question

Reverse array of elements without using additional memory.

Interview Answer

Anonymous

Sep 5, 2017

Brute force solution with swap will take O(1) additional memory, so I wrote my own swap function without additional memory using simple arithmetic.