Smarkets interview question

Reverse an array.

Interview Answer

Anonymous

19 Apr 2018

Did it in O(n) without an additional data structure. Loop through half of the array and use a temp variable to swap values.