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.
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.
Kata are rated based on community vote. This kata was published a little over 11 years ago, when the community was very new. The community has gotten more skilled, educational resources have become a lot more accessible, and expectations around coding proficiency have increased over time. You're correct that if this kata were to be rated today, it would likely be voted as a 6-kyu kata, but ranks are very difficult to change and it's not worth going through the long process to do so in 99% of cases. Just be happy with your easy points.
This comment is hidden because it contains spoiler information about the solution
well than we would write out the code to get that anwser for the client, but when the client doesnt specify what they are looking for you cant expect the programmer to read their mind. Its like getting ice cream if you just ask for ice cream and get vanilla but you wanted mint choclate how was I supposed to know.
Adding comments may help as in your solution, kudos for that.
However using a bunch of
if
s that only vary by a word/letter is not very pythonic as well.Meaningful variable names is often much better than a long comment.
If you remove the comments in your solution, it is not much different than this solution, just longer.
From your complaint I cannot really figure out what is the problem here. Your solution does not pass tests, so it is not valid. It consistently fails the "Efficiency tests (up to 2^30)" group. It seems to be simply too slow.
So what is the problem here?
I swear that if I see anyone else posting in this thread or telling anyone to go anywhere, or sending a report to moderation while still escalating this pointless exchange, they gonna get a break from Codewars.
Also, an author of many fine original kata.
This isn't stackoverflow, go back to where you belong
Btw, have a look at my stats:
Please patronise me again when you are as active as I am for this community.
Indulge me, stranger, why should I even be a role model?
I don't care :)