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
Similar Kata:
Stats:
Created | May 17, 2015 |
Published | May 17, 2015 |
Warriors Trained | 9727 |
Total Skips | 292 |
Total Code Submissions | 29668 |
Total Times Completed | 5101 |
JavaScript Completions | 3112 |
Ruby Completions | 396 |
Python Completions | 1541 |
PHP Completions | 154 |
CoffeeScript Completions | 11 |
Total Stars | 126 |
% of votes with a positive feedback rating | 90% of 885 |
Total "Very Satisfied" Votes | 744 |
Total "Somewhat Satisfied" Votes | 104 |
Total "Not Satisfied" Votes | 37 |