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

Stats:

CreatedSep 22, 2013
PublishedSep 22, 2013
Warriors Trained615742
Total Skips63657
Total Code Submissions989611
Total Times Completed301435
JavaScript Completions118937
CoffeeScript Completions410
Haskell Completions3257
Ruby Completions10625
Python Completions125616
C# Completions14936
Rust Completions3404
Clojure Completions425
PHP Completions6698
Groovy Completions144
Julia Completions216
Nim Completions68
R Completions398
Elixir Completions417
F# Completions185
Prolog Completions79
C Completions2344
Java Completions12194
Crystal Completions32
Scala Completions491
TypeScript Completions4618
COBOL Completions18
Go Completions2009
Total Stars4093
% of votes with a positive feedback rating88% of 26485
Total "Very Satisfied" Votes20901
Total "Somewhat Satisfied" Votes4898
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