6 kyu
Unique In Order
6,436 of 195,080pinelopi
Description:
Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements.
For example:
unique_in_order('AAAABBBCCDAABBB') == ['A', 'B', 'C', 'D', 'A', 'B']
unique_in_order('ABBCcAD') == ['A', 'B', 'C', 'c', 'A', 'D']
unique_in_order([1,2,2,3,3]) == [1,2,3]
Algorithms
Fundamentals
Similar Kata:
Stats:
Created | Feb 19, 2015 |
Published | Feb 19, 2015 |
Warriors Trained | 379294 |
Total Skips | 50343 |
Total Code Submissions | 879269 |
Total Times Completed | 195080 |
Python Completions | 85112 |
Ruby Completions | 6436 |
JavaScript Completions | 83763 |
C# Completions | 7478 |
PHP Completions | 4225 |
Clojure Completions | 448 |
Haskell Completions | 1535 |
Crystal Completions | 23 |
Rust Completions | 1732 |
C++ Completions | 5105 |
Scala Completions | 270 |
BF Completions | 14 |
TypeScript Completions | 837 |
CoffeeScript Completions | 7 |
Total Stars | 3288 |
% of votes with a positive feedback rating | 89% of 15079 |
Total "Very Satisfied" Votes | 12011 |
Total "Somewhat Satisfied" Votes | 2766 |
Total "Not Satisfied" Votes | 302 |