Use what your language offers you. Codewars uses PostgreSQL and I will use LIMIT if PostgreSQL allows me. It is infinitely more readable than your solution.

this code worked in python 2. You're using python 3, that's the root of the problem you're facing. (filter returns a generator, in python 3, not in python 2)

I don't think it's the best solution from programming point of view.

Actually, it is. There's a reason why every IT student has to take math classes. Try to understand Machine Learning without Statistics, or Image Processing without Analysis, or Computer Graphics without Linear Algebra. Without at least some basic maths, you'll be lost as soon as your solution doesn't work, or when you have to implement something non-standard.

Because summation and factorial are totally unrelated?

Awesome!

This should be the best solution. The top voted one has a more expensive time complexity because of the slicing. Great work.

It's not about size. In point-free version

`cycle "10"`

will most likely be evaluated only once (even if you don't really need it in this case)Use what your language offers you. Codewars uses PostgreSQL and I will use LIMIT if PostgreSQL allows me. It is infinitely more readable than your solution.

Should be downvoted for 'best practices' for leaving the misleading comment there :)

Oh ok we can use the mathematical formula for the sum instead.

Can someone explain why this solution is suboptimal.

Goddamit

Didn't have a good night's rest, guess it's time to switch off all screens for some hours.

Thank you kind sir.

this code worked in python 2. You're using python 3, that's the root of the problem you're facing. (filter returns a generator, in python 3, not in python 2)

I feel dumb

It only seems to be working for round numbers in Python 3.6. Does anyone know why?

i feel ashamed after i saw this solution.

Actually, it is. There's a reason why every IT student has to take math classes. Try to understand Machine Learning without Statistics, or Image Processing without Analysis, or Computer Graphics without Linear Algebra. Without at least some basic maths, you'll be lost as soon as your solution doesn't work, or when you have to implement something non-standard.

## Loading more items...