Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    You can upvote this kata by choosing Very in the satisfaction rating.

  • Custom User Avatar

    Fixed.

  • Custom User Avatar

    Five years have passed and have not been fixed.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Floats are not odd or even because you can always add a zero at the end.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    the trick is that even and odd numbers must be integers by definition, float (which is not integer at the same time) can neither be even nor odd

  • Custom User Avatar

    Thanks. Updated.

  • Custom User Avatar

    Not Sure who you wanted to notify, but Congrats ^_^

  • Default User Avatar

    Many Ms Man makes some good points.

    One line functions are bad functions. Knowing how to read them will help because many people write them.

    Don't be worried that you can't comprehend them. Rewrite them on multiple lines using variables and you will find that you can comprehend the logic and what they have done is obfiscate it through their "cleverness". This is the definition of unreadable code. It isn't clever, it's unreadable (not to mention undebuggable).

    Always write your code as though you are not going to be the person to maintain it. As much as possible it should be self documenting. If your code becomes difficult to understand because it isn't self describing due to an important consideration like performance, comment it. Instruct people why you have done what you have done.

    It is not you who are falling short here. One line code writers without explanatory documentation are bad at what they do.

  • Custom User Avatar

    Thank you :) Yes, I love looking at everyone elses solution and seeing their much more elegant solutions than mine. That's why I'm only 8 kyu though. Very, very 8 kyu.

  • Custom User Avatar

    You do not have to make all your solutions as one-liners. In real applications, I think one-liners are usually bad practice because they tend to be less readable (not always, though).

    Those one-liners you see in solutions are mainly for fun, to show a "smart" way of solving things.
    However, it is a good idea to learn to read them well, as it will make your code reading skills better.

    And to learn to read one-liners, you should try make one yourself :) Vicious circle!

    I think it is a good idea to ask questions how a solution works if you cannot comprehend it yourself. It will help you develop your skills faster!

  • Custom User Avatar

    Hmm It is supposed to be a beginner kata.

  • Custom User Avatar

    Sorry, cannot add new tests now - after 500 solutions submitted, test cases are uneditable (this is a CodeWars-wide feature).

    Why do you think this is such a special case?

  • Loading more items...