You know that trolls starve when not fed? I do not know if the OP is a troll or not, but whenever you think you see one, just don't feed it. You reply, you lose.
what a troll lol, you're just mad you had to use a loop like a LOSER. good for you though commenting an explanation of what an odd number is, really top notch best practice stuff. Do you usually go on codewars before or after your shift at google?
Simpler, faster algorithms are more maintainable and consume fewer resources. Seems to me like you didn't notice that there was a more efficient solution than the one you created, and now you're trying to turn that into a virtue instead of trying to learn from it. OK, so you didn't optimize the algorithm as much as it can be optimized. It didn't matter for this problem. But if you want to learn to write efficient code, I think this is a really valuable lesson to learn.
in every world outside your little computer science problem. your problem is that you don't see beyond your little world of computer science and math. that's why somebody without a CS degree is signing your paycheck.
closed form solutions have limited application in the real world. the real world is non-linear. nobody gives a crap about the sum of first n-odd numbers in any real world application. in my view the purpose of the kata is to recognize the pattern in the numbers and think through how to replicate the pattern in code, and then solve the pattern. the purpose of this 7-kyu kata is to help new programmers learn list comprehension, range() and other features of the python language. newbies can't learn programming from these "clever" math tricks. i can only imagine somebody new to programming spend an hour solving this, only to be bamboolzed by the 4 character "best practices" solution.
i'm not a genius like you though, i don't pretend to know everything.
To everyone saying it's not working - just one thing missing to work properly. Instead of / 30 use // 30 and problem solved.
is there any difference between this two very similar solutions?
You forgot to count your points, I'm surprised this passed
Same! TIL
A quick word of thanks - I actively learned from this. I appreciate all of you who put this answer in and helped make my code better. :)
The conditions are reversed, while not exactly the same the function is continuos when n or m are 0 so, the result is the same.
I think here sould be 'OR' instead 'AND'. It said in task`s condition..
Clever! I added an extra line I suppose
Use spoiler flag next time, your post was visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
very nice!
You know that trolls starve when not fed? I do not know if the OP is a troll or not, but whenever you think you see one, just don't feed it. You reply, you lose.
what a troll lol, you're just mad you had to use a loop like a LOSER. good for you though commenting an explanation of what an odd number is, really top notch best practice stuff. Do you usually go on codewars before or after your shift at google?
Simpler, faster algorithms are more maintainable and consume fewer resources. Seems to me like you didn't notice that there was a more efficient solution than the one you created, and now you're trying to turn that into a virtue instead of trying to learn from it. OK, so you didn't optimize the algorithm as much as it can be optimized. It didn't matter for this problem. But if you want to learn to write efficient code, I think this is a really valuable lesson to learn.
in every world outside your little computer science problem. your problem is that you don't see beyond your little world of computer science and math. that's why somebody without a CS degree is signing your paycheck.
closed form solutions have limited application in the real world. the real world is non-linear. nobody gives a crap about the sum of first n-odd numbers in any real world application. in my view the purpose of the kata is to recognize the pattern in the numbers and think through how to replicate the pattern in code, and then solve the pattern. the purpose of this 7-kyu kata is to help new programmers learn list comprehension, range() and other features of the python language. newbies can't learn programming from these "clever" math tricks. i can only imagine somebody new to programming spend an hour solving this, only to be bamboolzed by the 4 character "best practices" solution.
i'm not a genius like you though, i don't pretend to know everything.
Loading more items...