Ad
  • Default User Avatar
  • Default User Avatar

    The numbers used in the tests were far bigger than even u128 (what I think it's the biggest number in rust), which ruled out the possibility of using the "naive method" of storing the result in a normal variable. So what I did, rather than simply adding the numbers, was use both the sum and multiplication algorithms in order to calculate each digit alone, rather than the whole. That solution, unfortunately, used a whole lot of vectors with a whole lot of data which, I suppose, were the source of the bad performance. I understand that there are better solutions but not counting mine as correct made me really sad and frustrated, despite knowing that that is how codewars works. Nevertheless, I don't think I'll give up just yet; so if I ever get the time and the motivation I'll try it again. That's the reason why I haven't unlocked the other solutions yet.
    So yeah in a nutshell there were no infinite loops, my substandard code was the reason why it timed out, and this comment was just me, really frustrated, rambling about it because this has been happening to me a lot. I'll try to do more research next time… and if possible, make a one liner, rather than more than 100.

  • Custom User Avatar

    This kata (at least the languages I've solved this in) isn't performance intensive. It can be solved with the most naive method. It might well be that you actually have a bug in your code (like an endless loop)

  • Default User Avatar

    I've gotten execution time out after an hour or two of work. My code works, but it isn't efficient enough, apparently. The worst is that that has been happening in the majority of kata I do. It's a real bummer, and my motivation do to katas kinda plummeted after this one. I'm really sad.