Ad
  • Default User Avatar

    I had a look at if after a good night's sleep ... and somehow I must have screwed up. It's all clear. Sorry, for bothering you. ;-)

  • Default User Avatar

    If so they are mixed in all my PHP translations, tough work to change all that:-)

  • Default User Avatar

    I think the test cases in the PHP version have the params mixed up - i.e. "Expected" and "Actual" seem to be reversed.

  • Default User Avatar

    Good!! I'm happy for you!

  • Default User Avatar

    I was finally able to optimize to recurse less deeply while still finishing in 1000-1250ms and it passes now. Thank's again for the fast support & the great kata. This was really an interesting one.

  • Default User Avatar

    Thank you really much for the fast reply. I'm now pretty sure it's a limit to function level nesting, so I guess I'll have to modify my code somehow ... to be honest, I have no idea in the moment, how this kata can be solved without using any kind of recursion. ;-)

  • Default User Avatar

    I just tried and had no problem so it doesn't seem to be a problem of the kata. It could be a problem in your code or a Codewars problem. You might try again if you are sure of your code.
    The "Submit" tests are much longer than 225 ms, maybe 7 to 10 times more... unless you have a very good algorithm.
    If you are sure of your code and nothing goes better, you could report it as a bug at CW.

  • Default User Avatar

    I'm not sure if it's my solution or the PHP test cases, but I can't submit for some reason, but it won't tell me what went wrong.

    After pressing submit it just shows (with red background/border):

    Time: 255ms Passed: 0 Failed: 0
    Test Results:
    (green arrow) Sq2SquaresTestCases
    (green arrow) testBasic

    Can somebody please have a look at the PHP test cases, or advise what I can do here?

    Doing "RUN TESTS" however seems to correctly run the basic tests (50 & 44) and shows "You have passed all tests".

  • Default User Avatar

    +1 Very elegant indeed. This makes everything I've ever written in JS look like rubbish ...