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.
Thanks, approved.
Remove the TODO comments and we're good.
That's smart, I believe that's fixed now and changed references of array to list.
@Unnamed original author is inactive for 2 years, I have a fork with negative and random tests here https://www.codewars.com/kumite/558ba15428ca7d957c00004a?sel=5e58bfb2d33709001487916e
It's hard to judge actual speed of python based on theoretical time complexity, it varies a lot depending on user implementation and the internal C implementation of that code. For example, a, b = min(list), max(list) is usually a bit faster than iterating once with a for loop. Your solution is about 4-5x slower, from my tests at least.
This comment is hidden because it contains spoiler information about the solution
I suppose they're similar, but mine needs an extra conversion. I'm planning on making this a multi-parter with increasing difficulty/error checking, so this is more of a stepping stone(for me as well, being my first kata).
It's pythons way of making getters/setters. The @ symbol means the property function is used as a decorator, this is syntactic sugar for property(fget=info)(fget is the getter function). When someone wants the property named info(which was a variable initially) it returns the result of the info function instead.
(double post)
This comment is hidden because it contains spoiler information about the solution
Depends on whether you want an entire list to be generated or you might only need a partial, say if you had a for loop and wanted to break out of it when you get to a specific element.
In this case I don't believe it makes sense because you're returning the entire result anyway.
It means you can only call the getWeight funcion 4 times.
Love this one, great description/explanation and the right kind of challenging.
@dinglemouse
Thanks for the explanation. I noticed the sections rule but couldn't figure out what the purpose was, as it isn't clear from the examples what the significance is or what a day is in terms of the array.
To be more clear the description should say something along the lines of:
morning
,afternoon
, andevening
(every 3 values in the array is a full day)" - then followed by the other rules, perhaps nicely formatted.rains
or there is athunderstorm
he takes his umbrella out of his backpack and when it stops raining he puts it back.Loading more items...