Complete the function reverseArray to reverse Array.
Example
array = [17, 12, 15, 8, 9, 10, 5, 1, 6]
k = 4
output = [8, 15, 12, 17, 1, 5, 10, 9, 6]
Function Description
reverseArray has the following parameters:
arr: array of input
k: length of subset
Returns:
same arr as input with values modified
Complete the function reverseArray to reverse Array. Example array = [17, 12, 15, 8, 9, 10, 5, 1, 6] k = 4 output = [8, 15, 12, 17, 1, 5, 10, 9, 6] Function Description reverseArray has the following parameters: arr: array of input k: length of subset Returns: same arr as input with values modified