I want to have all possible combinations of a string without repeating a letter unless it exist more than once. And here some examples to clarify the idea:
"421" --> ["421", "412", "214", "241", "124", "142"]
"601" --> ["601", "610", "016", "061", "106", "160"]
"131" --> ["131", "113", "311"]