6 kyu
Unique In Order
84,544 of 193,938pinelopi
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 | 377525 |
Total Skips | 50217 |
Total Code Submissions | 876478 |
Total Times Completed | 193938 |
Python Completions | 84544 |
Ruby Completions | 6427 |
JavaScript Completions | 83368 |
C# Completions | 7433 |
PHP Completions | 4205 |
Clojure Completions | 448 |
Haskell Completions | 1530 |
Crystal Completions | 23 |
Rust Completions | 1722 |
C++ Completions | 5061 |
Scala Completions | 269 |
BF Completions | 14 |
TypeScript Completions | 781 |
CoffeeScript Completions | 7 |
Total Stars | 3275 |
% of votes with a positive feedback rating | 89% of 15053 |
Total "Very Satisfied" Votes | 11990 |
Total "Somewhat Satisfied" Votes | 2762 |
Total "Not Satisfied" Votes | 301 |