when using list comprehensions, if you have no else to add, you should use the if after the for not before it. I guess that's the reason
try it yourself.
I've tried both solutions on the same dataset as here, then added some random generated data also. And at the average my solution is faster (at least on my machine & my test method). But anyway due to Python3 is an interpreted language it will be slow always.
P.s. your solution has better performance than mine also, good job!
same here LOL
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
when using list comprehensions, if you have no else to add, you should use the if after the for not before it. I guess that's the reason
try it yourself.
I've tried both solutions on the same dataset as here, then added some random generated data also. And at the average my solution is faster (at least on my machine & my test method). But anyway due to Python3 is an interpreted language it will be slow always.
P.s. your solution has better performance than mine also, good job!
Its funny that you consider performant code the most important factor while complaining about a more performant solution than your own.
This comment is hidden because it contains spoiler information about the solution
я в шоке, это прекрасно
Useful when you want to learn 'not in' list
nice job
I tried this one but it kept asking me to add an else statement
Kata retired.
This comment is hidden because it contains spoiler information about the solution
yes! they are so difficult to understand for beginners
I did it this way and was so proud of myself for figuring out the list comprehension XD
Loading more items...