7 kyu

Find Duplicates

3,136 of 5,148loickreitmann

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 Trained9806
Total Skips293
Total Code Submissions29878
Total Times Completed5148
JavaScript Completions3136
Ruby Completions397
Python Completions1563
PHP Completions155
CoffeeScript Completions11
Total Stars126
% of votes with a positive feedback rating90% of 890
Total "Very Satisfied" Votes746
Total "Somewhat Satisfied" Votes106
Total "Not Satisfied" Votes38
Ad
Contributors
  • loickreitmann Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • Madjosz Avatar
  • user8436785 Avatar
  • yLaWy Avatar
  • LosBlobbos Avatar
Ad