6 kyu
Unique In Order
84,570 of 193,990pinelopi
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]
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 | 377578 |
Total Skips | 50221 |
Total Code Submissions | 876592 |
Total Times Completed | 193990 |
Python Completions | 84570 |
Ruby Completions | 6427 |
JavaScript Completions | 83382 |
C# Completions | 7438 |
PHP Completions | 4206 |
Clojure Completions | 448 |
Haskell Completions | 1530 |
Crystal Completions | 23 |
Rust Completions | 1722 |
C++ Completions | 5065 |
Scala Completions | 269 |
BF Completions | 14 |
TypeScript Completions | 783 |
CoffeeScript Completions | 7 |
Total Stars | 3276 |
% of votes with a positive feedback rating | 89% of 15055 |
Total "Very Satisfied" Votes | 11992 |
Total "Somewhat Satisfied" Votes | 2762 |
Total "Not Satisfied" Votes | 301 |