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.
Very cool kata, kudos to the author g964! I learnt so much solving it, had no idea about backtracking and how it works, went into rabbit hole of learning for a couple of days and was able to go back and solve it with new knowledge. Exactly the reason I love this site so much, very satisfying. Thanks!
Because in real cases the task may change to "divide by 6 if it's even and multiply by 10 if it's not". You would have to rewrite the whole logic of your function. If you had simple if/else then you just change a couple of numbers here and there.
Also, if/else is more readable and explicit.
Again, it's clever, but not the 'best' pracitce.
That is very cool solution. I wish I guessed it
Damn this is clever. I wonder if I'm too old and dumb to find solutions like that :/
Could you elaborate for us slower types, please?
This comment is hidden because it contains spoiler information about the solution
Damn this is cool
You're totally right, Chrono79!
I completely overlooked empty lists, thank you for helping me
Any solution with list comprehension doesn't work even for built in test case.
I don't understand why is this happening, because in test case the list is not empty. I generate proper list, it prints it out correctly, but it won't work for np.lcm.reduce even though it should.
Python. I am not getting this error in my IDE.
If I write it as np.lcm.reduce([2. 3, 4]) it works perfectly.
I believe there's an issue of some kind. How does it work for given list and not working with simplest list comprehension?
Thanks, I got it because of your explanation
I don't get it :|
Fun kata, had fun, thanks
Cool kata, made me think. Took a couple of tries, but was very enjoyable. Thanks
I broke my head trying to wrap it around this generator. To understand it easier consider writing it like this:
[number for subarray in array for number in subarray]
Still not easy though :|
Loading more items...