7 kyu

Four/Seven

1,798 of 4,545beniolenio
Description
Loading description...
Puzzles
  • Please sign in or sign up to leave a comment.
  • ptihiy Avatar

    Nice one though you understand it was really easy at the end.

  • Quark Fox Avatar

    What a great kata, the one kata everyone should try!! Such a simple ask and so many variety in solutions, Really human brain is Awesome.........

  • Unnamed Avatar

    This comment has been hidden.

  • nomennescio Avatar

    For LC: To make things worse, because all asserts are written in a single it, it's impossible to see which assertion failed. I do not think that's acceptable.

  • nomennescio Avatar

    LC issue? Passing Sample Tests, but during Random Tests I get : "expected 7 to equal +0" (??)

  • qrt88 Avatar

    Wow. After completing this and seeing the other solutions I can confidently say that I was overthinking this one. It was fun tho. Great kata!

  • NikCSharp Avatar
  • JohanWiltink Avatar
  • laurelis24 Avatar

    Honestly no idea how i solved this. Lol. Condifence boost. :D

  • Obikawa Avatar

    This comment has been hidden.

  • HerrWert Avatar

    I passed with a solution that actually would not work if n == 10.

  • FArekkusu Avatar

    The "random tests" are not really random in Python, JavaScript, Java, and PHP.

    Stop resolving issues without fixing them (or even understanding why something is wrong).

  • FArekkusu Avatar

    Actual and expected values are flipped in Java and PHP.

  • sirojga Avatar

    Log number =7

    expected:<21> but was:<4>

    wtf? by condition it should be 4 if number was 7

  • aviral_gupta14 Avatar

    This comment has been hidden.

  • FArekkusu Avatar

    The "random tests" are not really random in Python, JavaScript, Java, and PHP.

  • Moranilt Avatar

    This comment has been hidden.

  • Ring2020 Avatar

    I really this kata due to its difficult and challenge of the solution which could be in a various way. I personally think this kata could upgrade to 6kyu at least. For those who have some experienced with programming. I mean not for the beginner.

  • Unnamed Avatar

    Python expects any falsy result, JS expects only 0, PHP says "return 0", but expects any falsy value. What is this?

  • JohanWiltink Avatar
  • drexduarte Avatar

    This comment has been hidden.

  • Litusiano Avatar

    I love this kata. Could you make one for 6kyu?

  • sirsolofman Avatar

    I like this one, I'm going to look up more "puzzles" in the future. That being said, it feels like it's inescapable from feeling like a "cheating smartass" when solving this, since conditionals are not totally out of the question. Just "if". At least, going by the answers, that's how it seems like.

  • hobovsky Avatar

    This kata is doomed to end up as a mess of translations with unenforceable requirements and tests full of holes created by clueless translators. Things like eval, preprocessor, escape sequences, aliases, macros, available across languages and translators not knowing about them will turn it into a task of "please, don't do this" :/

  • hobovsky Avatar

    This comment has been hidden.

  • Avaini Avatar

    Some user came up with pretty clever solution using eval. While it is really cool, I feel like it goes agains the spirit of this kata. Maybe you should prohibit using ofeval too?

  • arxitim Avatar

    I really liked this kata, but for the first couple of minutes I was trying to figure out what false-y was in the description and in the test-cases. Could it be a typo?

    Maybe it would be better:

    Anything else such as False, 0, [], "" as input, sholud return False
    

    P.s: I apologize if i don't understand the terminology (or slang?) i'm not from an English-speaking country :-)