Permutations

samuel Jo·2022년 12월 5일
0

codewars

목록 보기
11/47

In this kata you have to create all permutations of a non empty input string and remove duplicates, if present. This means, you have to shuffle all letters from the input in all possible orders.

Examples:

  • With input 'a'
  • Your function should return: ['a']
  • With input 'ab'
  • Your function should return ['ab', 'ba']
  • With input 'aabb'
  • Your function should return ['aabb', 'abab', 'abba', 'baab', 'baba', 'bbaa']
    The order of the permutations doesn't matter.

이문젠데 , 감이 안잡힌다.. 내일 더생각해보고 모르면 풀이를 봐야할듯하다.

ex) 'abc' 3! => abc
acb
bac
bca
cab
cba

profile
step by step

0개의 댓글