0

If the input provided is “546”, then your solution should return "654,645,564,546,465,456" as these are all the combination that can be made with integers

I am not 100% sure what algorithm to use to achieve the most efficient answer

bee
  • 229
  • 1
  • 2
  • 7
  • Cross-site dupe https://codereview.stackexchange.com/q/7001 - just make your number a string and split it into characters first. – Jack Bashford Jul 20 '19 at 14:46
  • This is normally called "generating all permutations", not sorting, which is the word used for generating a *specific* permutation according to an ordering rule – harold Jul 20 '19 at 14:48

0 Answers0