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.
Funny...I just came up with and submitted the same exact algo!
Just passed the full suite test. 82 is fairly close, fyi.
My code is too slow. How far off am I?
Passed: 82 Failed: 0 Exit Code: 1
@tonylicoding - I didn't even realize that I had already successfully completed this kata six months ago. Just realized it now after submitting my newer version and saw that my stats didn't move. Upon checking why the stats didn't move, I noticed the earlier submission :-|
Thanks for your tips. Setting flush=True was helpful. After doing that and some other checks I was able to see that I was failing some of the corner cases.
Also, your code works.
You may be running your code with the print statements. If you print while running your code and your code is too slow, ofc it will time out. What are you trying to print, if your code times out? The input, maybe one test is causing the trouble, but there's also the probability that your code in general isn't fast enough. I tried doing
print(n)
, and it works@CloudClique: try with this
print("Hello world!", flush=True)
EDIT: @hobovsky: I just tried it and it works.
Try flushing stdout after each print, and please let me know if it helps. I am interested if flushing helps to display truncated output in Python runner.
Should simply adding a print statement as below work to show the n value being input/tested??
def next_bigger(n):
print(n)
'my code here'
I've tried this and ran test but I get no output....just 'Execution Timed Out (12000 ms)'
If I insert print statements into my code and run against the sample tests(which all pass) I can see the output in the test result logs. If I do the same for the full test suite(which is timeing out) none of the same print statements are logged. Any hints on how to better utilize the logging functionality? Thanks.
Not sure why but my solution failed the sample tests(see above) but passed the full test suite.
I think I'm missing something with this test: Test.assert_equals(encode_rail_fence_cipher( ;
I'm a bit confused on what the intent is here. Any hints?
I sorta winged it. Can't say that I used any formal references or study material.
Any resources to share on graph theory and how that helped you find the solution? Its been a decade since I took Discrete.
Loading more items...