Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The answer for that expression is 8. You're reading the logs wrong.
Could someone explain me please why is this test asking me to output 1 instead of -1?
-9136--96474=?733?
I handled the fact that the 1 cannot be part of the whole answer because it's already included on -9136. So nothing comes to mind rn.
It's the next bigger number, not the biggest number, and it's been asked and answered before (for instance GolivetsAndreu's post). Try reading the posts already here next time, sometimes they have already the answer you look for.
This comment is hidden because it contains spoiler information about the solution
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.
1234567890
, and59884848459853
If I got test cases correctly, then indeed the next bigger number with the same digits as
1234567890
(input) is1234567908
(as expected), and not1234568079
, 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.
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.
This comment is hidden because it contains spoiler information about the solution
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
This comment is hidden because it contains spoiler information about the solution