5 kyu

Array.diff hero

Description:

You know about simple Array.diff task. Now try to solve enhanced version!

Your goal in this kata is to implement a difference function, which subtracts one list from another.

It should remove all values from list a, which are present in list b. Each element x in both arrays is integer and 0 ≤ x ≤ 25. And lengths of arrays can reach 5 000 000 elements.

arrayDiffVeryFast([1,2],[1]) == [2]

If a value is present in b, all of its occurrences must be removed from another:

arrayDiffVeryFast([1,2,2,2,3],[2]) == [1,3]
Arrays
Fundamentals

More By Author:

Check out these other kata created by Iprit

Stats:

CreatedNov 7, 2016
PublishedNov 7, 2016
Warriors Trained2008
Total Skips107
Total Code Submissions4423
Total Times Completed733
JavaScript Completions733
Total Stars51
% of votes with a positive feedback rating84% of 137
Total "Very Satisfied" Votes105
Total "Somewhat Satisfied" Votes19
Total "Not Satisfied" Votes13
Total Rank Assessments9
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Iprit Avatar
  • smile67 Avatar
  • JohanWiltink Avatar
  • Voile Avatar
  • akar-0 Avatar
Ad