6 kyu
Array.diff
118,937 of 301,435marcinbunsch
Description:
Implement a function that computes the difference between two lists. The function should remove all occurrences of elements from the first list (a
) that are present in the second list (b
). The order of elements in the first list should be preserved in the result.
Examples
If a = [1, 2]
and b = [1]
, the result should be [2]
.
If a = [1, 2, 2, 2, 3]
and b = [2]
, the result should be [1, 3]
.
Arrays
Fundamentals
Algorithms
Similar Kata:
Stats:
Created | Sep 22, 2013 |
Published | Sep 22, 2013 |
Warriors Trained | 615742 |
Total Skips | 63657 |
Total Code Submissions | 989611 |
Total Times Completed | 301435 |
JavaScript Completions | 118937 |
CoffeeScript Completions | 410 |
Haskell Completions | 3257 |
Ruby Completions | 10625 |
Python Completions | 125616 |
C# Completions | 14936 |
Rust Completions | 3404 |
Clojure Completions | 425 |
PHP Completions | 6698 |
Groovy Completions | 144 |
Julia Completions | 216 |
Nim Completions | 68 |
R Completions | 398 |
Elixir Completions | 417 |
F# Completions | 185 |
Prolog Completions | 79 |
C Completions | 2344 |
Java Completions | 12194 |
Crystal Completions | 32 |
Scala Completions | 491 |
TypeScript Completions | 4618 |
COBOL Completions | 18 |
Go Completions | 2009 |
Total Stars | 4093 |
% of votes with a positive feedback rating | 88% of 26485 |
Total "Very Satisfied" Votes | 20901 |
Total "Somewhat Satisfied" Votes | 4898 |
Total "Not Satisfied" Votes | 686 |