1. Question 1
Odd-Even-Transform Problem works on an array of integers (both positive, negative
and zero), by taking in a value (a whole number) that specifies the number of times
the transformation has to be applied.
On an array of integers, the transformation that needs to occur, n number of times:
• Adds three (+3) to each odd integer.
• Subtracts three (-3) from each even integer
Example:
[3, 4, 9], 3 means, the array with integers 3,4,9 has to undergo transformation 3
times.
[3, 4, 9] => [6, 1, 12] => [3, 4, 9] -> [6,1,12]
So the result is [6,1,12]
Function Description
Complete the function oddEvenTransform in the editor below.
oddEvenTransform has the following parameter(s):
arr: an array of integers