Exercise 1: Extract Even Elements from an Array

Extract the even numbers from an array.

Problem statement

Extract the even integers from the given array.

Example

input_array contains [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Output is [2, 4, 6, 8, 10]

Try it yourself

Press + to interact
def even_elements(input_array)
result = []
# Start your code here
return result
end