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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
ohhh. cool
It'd work anyways.
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
This comment is hidden because it contains spoiler information about the solution
i like this solution cleaner and clear
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
Thanks!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That's because you didn't use elif. But it shouldn't matter if you return the price instead of printing it, return ends the function.
Loading more items...