Ad
  • Default User Avatar

    I am not the Scala translator but the tests in Scala are less difficult than in other languages (because Scala as all languages derived from Java is rather slow at CW). I tried many solutions and several run under 10500 ms. 65 guys passed the kata so I think it is doable. If you want to use recursion think of import scala.annotation.tailrec.
    Note: the only difficulty of the kata is about performance...

  • Custom User Avatar

    Now I look at that, I think I am wrong about timeout. I believe your recursive solution fails with stack overflow error, that's why it does not show anything in output panel.

  • Custom User Avatar

    Your solution does not pass all the tests, it times out crashes. Strange thing is, output panel does not tell you that :(

    EDIT: I think my suspicion of timeout was incorrect.

    In Scala, there are 75 tests and they are unfortunately running in time close to timeout, so if your solution is for some reason not close to "intended approach", you risk running out of time.

    Your solution passes ~65 tests, so you are probably rather good with your general idea, unfortunately I am afraid you will have to tweak it somehow to squeeze these additional 10 test cases. You might try some approach without recursion, if you can come up with any.

    I will think about raising an issue to decrease amount of test cases to allow other valid approaches.