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 helped a lot. Thanks. Haha
Yeah, this needs memoization. Lots of repeated calculations. Super inefficient.
Agreed, I remember reading that somewhere -- but why? because of the lambda function, right?
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!
It's all about reading and learning. All those wheels are out there, no need to reinvent them.
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.
Why not though?
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
Have you seen the sample tests?
The first one is an empty list. And that's what the error is about.
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.
Loading more items...