In this kata you will create a function that takes in a list and returns a list with the reverse order.
* [1, 2, 3, 4] -> [4, 3, 2, 1]
* [9, 2, 0, 7] -> [7, 0, 2, 9]
def reverse_list(list)
reversed_list = []
index = list.size - 1
while index >= 0
reversed_list << list[index]
index -= 1
end
reversed_list
end
def reverse_list list
list.reverse
end