Skip to content

Files

Latest commit

cc599fc Β· Mar 10, 2025

History

History

even-numbers-in-an-array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 10, 2025
Mar 10, 2025
Mar 10, 2025

Given an array of numbers, return a new array of length number containing the last even numbers from the original array (in the same order). The original array will be not empty and will contain at least "number" even numbers.

For example:

([1, 2, 3, 4, 5, 6, 7, 8, 9], 3) => [4, 6, 8]
([-22, 5, 3, 11, 26, -6, -7, -8, -9, -8, 26], 2) => [-8, 26]
([6, -25, 3, 7, 5, 5, 7, -3, 23], 1) => [6]