6 kyu

Array.diff

118,868 of 301,220marcinbunsch

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

Stats:

CreatedSep 22, 2013
PublishedSep 22, 2013
Warriors Trained615344
Total Skips63625
Total Code Submissions989078
Total Times Completed301220
JavaScript Completions118868
CoffeeScript Completions410
Haskell Completions3255
Ruby Completions10623
Python Completions125517
C# Completions14927
Rust Completions3403
Clojure Completions424
PHP Completions6696
Groovy Completions144
Julia Completions215
Nim Completions68
R Completions398
Elixir Completions417
F# Completions185
Prolog Completions79
C Completions2343
Java Completions12183
Crystal Completions32
Scala Completions490
TypeScript Completions4603
COBOL Completions18
Go Completions2004
Total Stars4091
% of votes with a positive feedback rating88% of 26479
Total "Very Satisfied" Votes20896
Total "Somewhat Satisfied" Votes4897
Total "Not Satisfied" Votes686
Ad
Contributors
  • marcinbunsch Avatar
  • jhoffner Avatar
  • xcthulhu Avatar
  • bkaes Avatar
  • electricdusk Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • suic Avatar
  • joecastle Avatar
  • 10XL Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • erickhagstrom Avatar
  • kleidemos Avatar
  • adrian.eyre Avatar
  • B1ts Avatar
  • Blind4Basics Avatar
  • Torkel Avatar
  • Voile Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • danmbyrd Avatar
  • metagn Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • dfhwze Avatar
  • suyundukov Avatar
  • m1cha3l Avatar
  • saudiGuy Avatar
Ad