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.
I need to stop using a lot of lines, this one resumes it all.
Very clean solution
Oh! If only I'd actually written the math down on a piece of paper.
That is so elegant :)
Yup, at that time I was. Maps and Lambdas are not unique to Python, so was aware of how to use them (and solve this) in other languages, and worked out how to do the same in Python. Never thought to go look to see if there was a Python function to do the work for me!
"python newbie"
knows about
map
andlambda
if it requires please do not hesitate, for example a formula or bulit in fuction the goal is to learn
Obsolete issue, closing
good solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
the python reads all the line becaue all in same line and same interpretting so python read it if it another line there would be an eror
nice
I get where you are coming from...but could you please elaborate on what principles of a pure function it violates?
I may be missing something - but doesn't it comply with not having side effects (i.e. nothing mutated), and it would produce the same result every time given the same inputs? Is it because of the 'lines' param being a reference variable, which could be changed outside of the method?
" Please keep in mind that the test cases ensure that the number of people in the bus is always >= 0. "
But this condition: "So the return integer can't be negative." is not fulfilled.
If the last number in the test would be 100, for example, this code returns negative value
Loading more items...