Array to even
Medium
9
9.0% Acceptance
- Create a function
even(array, length of array)
. This function will take two arguments: a dynamicuint
type array and the length of the array. - The
even()
function will multiply each element of the array by 2.
Example:
- If
array = [2, 5, 11, 1]
, theneven()
should return[4, 10, 22, 2]
. - If
array = [1, 3, 5, 7]
, theneven()
should return[2, 6, 10, 14]
.
NOTE: The function should be public.