4 kyu
So Many Permutations!
12,678 of 49,720BattleRattle
Description:
In this kata, your task is to create all permutations of a non-empty input string and remove duplicates, if present.
Create as many "shufflings" as you can!
Examples:
With input 'a':
Your function should return: ['a']
With input 'ab':
Your function should return ['ab', 'ba']
With input 'abc':
Your function should return ['abc','acb','bac','bca','cab','cba']
With input 'aabb':
Your function should return ['aabb', 'abab', 'abba', 'baab', 'baba', 'bbaa']
Note: The order of the permutations doesn't matter.
Good luck!
Permutations
Strings
Algorithms
Similar Kata:
Stats:
Created | Oct 9, 2013 |
Published | Oct 9, 2013 |
Warriors Trained | 117227 |
Total Skips | 20771 |
Total Code Submissions | 206105 |
Total Times Completed | 49720 |
JavaScript Completions | 12678 |
Ruby Completions | 2289 |
Python Completions | 25559 |
Haskell Completions | 700 |
PHP Completions | 675 |
C++ Completions | 2816 |
Java Completions | 3272 |
C# Completions | 1968 |
Elixir Completions | 83 |
VB Completions | 18 |
COBOL Completions | 6 |
Go Completions | 345 |
Total Stars | 3382 |
% of votes with a positive feedback rating | 88% of 4324 |
Total "Very Satisfied" Votes | 3434 |
Total "Somewhat Satisfied" Votes | 750 |
Total "Not Satisfied" Votes | 140 |