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.
Clever solution!
Late reply, but you subtract one number from the "num_pill" since there exist only one space/distance in between two pillars. Same as all real life objects, there exist only one space in between two objects.
number of pillars (≥ 1) is given to us. We have no need to check it in our code
what is
num_pill - 1
?sorry I can't understand.
This would need input validation in produciton as entering a negative integer produces incorrect results. For example, entering -1 pillars returns -4000
resolve katas sometime like translation.your answer deserve “信,雅,达。”
numeric value of true is 1
numeric value of false is 0
i always forget True being 1 and False being 0. nice code
Won't this unnecessarily perform calculations which could be bypassed by testing for 1 pillar?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I've passed all the tests apart from the first edge case test. Any ideas?
Ooooh, I didn't realise it meant a list. Sorry about obvious spoilers. Thanks a lot for the help.
Woops, you're damn right about the location of the error, sorry... :/ (I need holidays, it seems...).
Tho, it still stands that the problem is in your code: the check function fails because you send to it an int instead of a sequence, meaning a
list
. ;)Note: when you post code, don't forget the spoiler flag and use proper markdowns so that it's easier to read it.
EDIT: I see that there are no visible expected outputs in the sample tests. That's unfortunate... you need to return lists of integers, here.
This comment is hidden because it contains spoiler information about the solution
Loading more items...