Ad
  • Custom User Avatar

    (Yeah, now I'm thinking of it, there seems to be an obvious way to make the code more efficient: I'm gonna try it :) )
    EDIT: LOL: in fact, it wasn't even necessary to do try the "complex/subtle/far-fetched" thing: I simply did the "little stpd trick" that had previously come to my mind, but which I had rejected thinking "nah this would be too stpd xD" ==> but that thing actually worked (to my biggest surprise)
    RE-EDIT: Now I'm seeing the solutions: I probably should have done the "subtle trick" rather than the "barbaric one" I used...
    ==> The highest rated solutions use that "trick" I had though of, but was too lazy to implement (as the "barbaric trick" just worked)...
    But apparently, "something" must have changed since the creation of this Kata: surprisingly, it seems like most submitted solutions simply consist in the "obvious algorithm" with "no trick at all", and apparently, they didn't experience "Time Out"...

  • Custom User Avatar

    Same thing here; passes the sample tests, but when I want to "submit", it "times out"...
    ...On the other hand, I must admit I coded it "in a rush" and in the most "obvious/naive/straightforward" way (I was even surprised to see that my "very first attempt" immediatly passed the sample tests); so there might possibly be a way to "make the code more efficient"...
    (It seems quite likely, as the "issue" seems to have been reported many times; and while those people's code is hidden, the replies state that tey weren't "efficient enough", so...)