7 kyu

Even numbers in an array

9,432 of 21,700Dmitry Kudla

Description:

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]
Fundamentals
Arrays

Stats:

CreatedDec 27, 2017
PublishedDec 27, 2017
Warriors Trained29309
Total Skips1496
Total Code Submissions56409
Total Times Completed21700
JavaScript Completions9432
Haskell Completions258
Ruby Completions556
Python Completions6504
C++ Completions2509
Crystal Completions18
Rust Completions658
TypeScript Completions605
Kotlin Completions992
Dart Completions621
COBOL Completions10
CoffeeScript Completions17
D Completions5
Lua Completions32
Julia Completions7
Prolog Completions9
Java Completions118
Total Stars188
% of votes with a positive feedback rating94% of 2382
Total "Very Satisfied" Votes2099
Total "Somewhat Satisfied" Votes260
Total "Not Satisfied" Votes23
Total Rank Assessments6
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Dmitry Kudla Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • smile67 Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • a.merezhanyi Avatar
  • Voile Avatar
  • KenKamau Avatar
  • monadius Avatar
  • ewingsa Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • krnets Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • RileyHunter Avatar
  • saudiGuy Avatar
Ad