Challenge: So Many Permutations!

bullishgopher

Sandy Nguyen

Posted on April 24, 2023

Challenge: So Many Permutations!

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']
Enter fullscreen mode Exit fullscreen mode

Note: The order of the permutations doesn't matter.

Have fun!!

💖 💪 🙅 🚩
bullishgopher
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.

Related

Challenge: So Many Permutations!
programming Challenge: So Many Permutations!

April 24, 2023