Write a function filter_even(arr) that returns a new list containing only the even numbers from the input array.
Example:
Input: arr = [1, 2, 3, 4, 5, 6, 7, 8]
Output: [2, 4, 6, 8]
Constraints:
Test Cases
Test Case 1
Input:
[1, 2, 3, 4, 5, 6, 7, 8]Expected:
[2, 4, 6, 8]Test Case 2
Input:
[1, 3, 5, 7]Expected:
[]Test Case 3
Input:
[2, 4, 6]Expected:
[2, 4, 6]+ 2 hidden test cases