Ad
  • Custom User Avatar

    Um, it would also be nice if I can see when I (and maybe other users too) completed a kata in a language.

    It would be in my profile, something like:

    Completed in languages: Ruby on November 22nd; Python on November 23rd, etc.
    
  • Custom User Avatar

    Doesn't work with really large m or n anymore. I failed at n = 45001 and n = 450010. The tests now go far beyond that.

  • Custom User Avatar

    Thank you for your answer. Such application of maths into CS.
    I ended up looking through Bernoulli polynomials, Nicomachus's theorem, Faulhaber's formula and stuff, none of which I understand.

    But I'll start reading more on Maths from now. And on algorithms.
    If you can kindly point to some resources, that'd be so great.

    But thanks again for your inspiring solution.

  • Custom User Avatar

    Yep. My solution is accepted, and it's wrong.

  • Custom User Avatar

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

  • Custom User Avatar

    There is a small error in the Ruby version.
    Instead of
    //TODO: complete ,
    it should be
    #TODO: complete

  • Custom User Avatar

    There's a syntax typo in the Python test case.
    Currently is test.assert_equals(words_to_sentence(['bacon', 'is', 'delicious'], 'bacon is delicious');
    Should be "test.assert_equals(words_to_sentence(['bacon', 'is', 'delicious']), 'bacon is delicious');"

  • Custom User Avatar

    I know my submission was not correct at all, but it passed the test anyways. I think we need a mathematical proof for this kata. Something like, there exists an y value so that if val < x < val + y, there will always be an x value that satisfies the instruction.