Challenge: So Many Permutations!
Sandy Nguyen
Posted on April 24, 2023
In this challenge, 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.
Have fun!!
💖 💪 🙅 🚩
Sandy Nguyen
Posted on April 24, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.