7 kyu

Even numbers in an array

2,503 of 21,672Dmitry 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 Trained29287
Total Skips1495
Total Code Submissions56364
Total Times Completed21672
JavaScript Completions9425
Haskell Completions257
Ruby Completions556
Python Completions6499
C++ Completions2503
Crystal Completions18
Rust Completions658
TypeScript Completions603
Kotlin Completions991
Dart Completions620
COBOL Completions10
CoffeeScript Completions17
D Completions5
Lua Completions31
Julia Completions7
Prolog Completions9
Java Completions112
Total Stars187
% of votes with a positive feedback rating94% of 2380
Total "Very Satisfied" Votes2097
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