Pergunta de entrevista da empresa Agoda

Create a function that can reverse an array of integer

Resposta da entrevista

Sigiloso

15 de out. de 2021

I came up with a swapping technique. Using a temp variable to store an array element that will be swapped between the first and last index of the array. Then, return the input array as a result this logic has a time complexity: O(n) and space complexity: O(1) where n is the amount array elements.