7 kyu

Find Duplicates

3,112 of 5,101loickreitmann

Description:

Given an array, find the duplicates in that array, and return a new array of those duplicates. The elements of the returned array should appear in the order when they first appeared as duplicates.

Note: numbers and their corresponding string representations should not be treated as duplicates (i.e., "1" != 1).

Examples

[1, 2, 4, 4, 3, 3, 1, 5, 3, "5"]  ==>  [4, 3, 1]
[0, 1, 2, 3, 4, 5]                ==>  []
Arrays
Fundamentals

Stats:

CreatedMay 17, 2015
PublishedMay 17, 2015
Warriors Trained9727
Total Skips292
Total Code Submissions29668
Total Times Completed5101
JavaScript Completions3112
Ruby Completions396
Python Completions1541
PHP Completions154
CoffeeScript Completions11
Total Stars126
% of votes with a positive feedback rating90% of 885
Total "Very Satisfied" Votes744
Total "Somewhat Satisfied" Votes104
Total "Not Satisfied" Votes37
Ad
Contributors
  • loickreitmann Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • Madjosz Avatar
  • user8436785 Avatar
  • yLaWy Avatar
  • LosBlobbos Avatar
Ad