Pergunta de entrevista da empresa Lyft

Given an N digit number, find all possible numbers that can be composed from it without reusing a digit. For example: 123 -> (1, 2,3, 12, 13, 21, 23, 31, 32, 123, 132, 213, 231, 312, 321)