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 is the easiest 4kyu I have seen,
I thought it was hard but not really apprently:)
Your conditions don't change with each call, its like having while True in your code. That's why you end up getting an error.
Not working any more due to timeout.
This means you'll eliminate double spaces.
This comment is hidden because it contains spoiler information about the solution
it's not list comprehension but 'generator expression' https://peps.python.org/pep-0289/
My first solution on codewars is the best-practice-solution, yoo-hoo!
No, this is very easy to read, and the pythonic way to do things in general.
Aaaah, I almost got it this way.
Is this a good practice in a project?
Doesn't it difficult to read?
I can finally comment and upvote. What's up with that codewars admin? so far only 8kyu enabled me to do so. Shame!
my brain doesn't work this way :(
Lovely. Simple and clever.
Hard to say, since that scenario isn't covered in the requirements or the test cases. I'm honestly not sure what the original writer of the kata would consider the "correct" solution for something like "UK".
Beware that this fails for "UK" for instance.
Hard disagree that your technique adds clarity.
People familiar with python are plenty used to generators, and your elimination of the generator actually confuses things. And people not used to generators really need to get used to them if they're going to be doing much programming in python.
Your solution is also really inefficient, since it's calculating
c
on every tick of the loop.Loading more items...