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
Similar Kata:
Stats:
Created | May 17, 2015 |
Published | May 17, 2015 |
Warriors Trained | 9806 |
Total Skips | 293 |
Total Code Submissions | 29878 |
Total Times Completed | 5148 |
JavaScript Completions | 3136 |
Ruby Completions | 397 |
Python Completions | 1563 |
PHP Completions | 155 |
CoffeeScript Completions | 11 |
Total Stars | 126 |
% of votes with a positive feedback rating | 90% of 890 |
Total "Very Satisfied" Votes | 746 |
Total "Somewhat Satisfied" Votes | 106 |
Total "Not Satisfied" Votes | 38 |