Ad
  • Custom User Avatar

    I was starting to create an implementation of BigInt that allowed me to multiply and get the modulo of large numbers while storing them as strings. And then I realized that the solution was waaaaaay simpler than that.

  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    There's sometimes a problem with the client when trying to submit solutions. Refreshing the page usually solves the "unknown error" issue.
    The "6000ms" error is 99% of the time due to an unoptimized algorithm. The Kata details hint at the algorithm needing to work with big numbers. Iterating through all the numbers won't work in the time constraint.

  • Default User Avatar

    I'd say my solution was a little brute forced. I recursively stripped the variable, so each iteration of my loop was faster than the last since it was producing a number that was the log5 of the last

  • Default User Avatar

    The difficulty of this kata comes from the mathematical component, not the programming one. It is a fun math problem, but it would be a lot more satisfying if it were solvable by brute (but optimized force) as well. Unfortunately, the Codewars' platform time and memory constraints are too low to allow any solution other than using the little math "trick" (speaking of my own Python solutions here).
    It was interesting trying to come up with optimizations to what I thought was a good approach to the problem, even if I didn't get the satisfaction of actually passing the large number test. And I also learnt the difference between range() and xrange(), so that counts as well :P

  • Default User Avatar

    This is so much cleaner than the current top voted solution.