Ad
  • Custom User Avatar

    The answer for that expression is 8. You're reading the logs wrong.

  • Custom User Avatar

    It's difficult to tell if these expected outputs are correct because you did not provide inputs. All we know from the log you pasted is expected answer, and actual (yours) answer. But without knowing the input, we cannot tell which is correct.

    Except two of them.

    • Message "1234568079 should equal 1234567908" seems to relate to fixed test with input value 1234567890, and
    • message "59884848498355 should equal 59884848483559" seems to relate to fixed test with input value of 59884848459853

    If I got test cases correctly, then indeed the next bigger number with the same digits as 1234567890 (input) is 1234567908 (as expected), and not 1234568079, as your solution apparently answered. The same thing applies to the second test, and I think it will be safe to assume the same for random tests.

    Your solution has a bug, and your answers are not correct.

  • Custom User Avatar

    Print the input too, those are only your wrong answers and the expected ones. In the first case, the input value was 1234567890, your code returned 1234568079 which is greater than 1234567908.

  • Custom User Avatar

    If tests say your solution is wrong, how can you know it's correct?

    I just retested my Python solution and encountered no broken case.

    Potentially helpful FAQ: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution