Ad
  • Custom User Avatar
    1. You create the permutation of the number, but did not use the permutation result.
    2. Even if you use the result, permutation still won't work with this problem. Permutation is too slow on numbers with plenty of digits.
    3. You created a condition that will never be true in the for loop (numbers_list[i] == n) unless the number is 1 digit, which has been handled by the earlier if statement

    I didn't mention all, but these are the red flags that can easily be spotted right away in your code.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution