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.
Print the input yourself.
LOL - amusingly I wrote: "I have two suggestions" -- then presented 3 items.
Reminds me of a joke:
Yeah but the test did not mention which string was tested, so no debugging is possible
(at least in python)
You've probably taken an approach that decrements the number until the new number has the same digits (i.e., next smaller) or some terminal case (e.g., 0, fewer-digits, etc.) This approach will timeout on this kata.
To get yourself unstuck, I have two suggestions:
My code finds the answer in:
177 ns ± 2.46 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each),
but time outs on the server.
next_smaller(11911)
->11191
Hello World.
How do I see hidden input values?
My code executes in 200ns localy on a large number like (123456789123456789123456789123456789123456789), but it time outs on the server and idk why.
%timeit next_smaller(9525144338352127488)
9525144338352124887
184 ns ± 0.33 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
Execution Timed Out (12000 ms) O_O
Thx.
My solution looks ugly but it's 2.5 times faster than the one at the top of Best Practices :)
Not an issue.
Your solution returned a wrong result.
Because True is not a number.
Why tests say "True should equal False"?
This comment is hidden because it contains spoiler information about the solution
Try reading the examples and problem description one more time
Welp, for me tests say 7 should equal 3. :| Python
Loading more items...