• Custom User Avatar

    Assumes all numbers are in range, returns error for if not.

  • Custom User Avatar

    Nice Kata. Love those inspirers!

  • Custom User Avatar

    As stated in prior comment, the description suggests that only natural numbers will be passed in as arguments. Test cases show otherwise, which is confusing. It would be best to establish input expectations in the description.

  • Custom User Avatar

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

  • Custom User Avatar

    Even when coming up with a solution that applies the same logic, it is amazing how one can overcomplicate code! This one is a nice, simple solution. Very intuitive.

  • Custom User Avatar

    @Ulin, very helpful explanation!

  • Custom User Avatar

    Wow, this is one of those where just when you feel you solved it you find out you were not even close, mostly due to a misunderstanding of the mechanics that yield the next bigger number. Check inputs against expected output carefully! and add your own tests with large numbers. Great kata to challenge yourself with!

  • Custom User Avatar

    Let's entertain the possibility that it's too difficult and that a simple loop should work. Well then, we might as well delete the kata, because there's nothing left of it.

  • Custom User Avatar

    If a 6-year-old can figure it out, then so could they. It isn't hard for someone with semi-functional brain at all. If it is, maybe they're in the wrong place.

  • Custom User Avatar

    This is by definition optimization and not something for absolute beginners. It really is a simple solution, but this would stump beginners who haven't been exposed to that.

    Edit- Look at all the comments made by 7kyu coders who don't understand why their code is timing out, and the responses. "Find a faster algoritm." "The kata is tagged performance for a reason."

    This really is a little hard on the new coders. Simple doesn't mean for absolute beginners.

  • Custom User Avatar

    I have to agree, it's not even "optimisation" its like year 6 maths.

    I'm actually tempted to argue that the "optimised" solution is actually easier than doing it some slower way, as well.

  • Custom User Avatar

    That depends on the values tested.

  • Custom User Avatar

    I get Timeout Error but when i test my code,it will be passed.

  • Custom User Avatar

    somebody approved it

  • Custom User Avatar

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

  • Loading more items...