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

Stats:

CreatedOct 9, 2013
PublishedOct 9, 2013
Warriors Trained117227
Total Skips20771
Total Code Submissions206105
Total Times Completed49720
JavaScript Completions12678
Ruby Completions2289
Python Completions25559
Haskell Completions700
PHP Completions675
C++ Completions2816
Java Completions3272
C# Completions1968
Elixir Completions83
VB Completions18
COBOL Completions6
Go Completions345
Total Stars3382
% of votes with a positive feedback rating88% of 4324
Total "Very Satisfied" Votes3434
Total "Somewhat Satisfied" Votes750
Total "Not Satisfied" Votes140
Ad
Contributors
  • BattleRattle Avatar
  • jhoffner Avatar
  • bkaes Avatar
  • GiacomoSorbi Avatar
  • donaldsebleung Avatar
  • ParanoidUser Avatar
  • aweleshetu Avatar
  • docgunthrop Avatar
  • Blind4Basics Avatar
  • Firefly2002 Avatar
  • Voile Avatar
  • KataSideKick Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • MobulaKuhlii Avatar
  • akar-0 Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • yLaWy Avatar
  • anusha.j Avatar
  • cwps Avatar
Ad