Ad
  • Default User Avatar

    Divide et impera

  • Custom User Avatar

    I have a JS algorithm that gets the correct solution, plenty fast enough to not timeout.
    However I am very stuck with overflow errors. If I use BigInts on a local version of Node it gets the correct answer instantly.
    The kata is on an old version of Node without BigInts.
    I have tried to many things. Spamming the modulus, got rid of any bitwise, tweeked my alg to keep numbers slightly lower - no luck. The best I've managed is around half of the final batch of 500 tests correct, the other half overflowed so turned out wrong. I'm at a loss.

    Any tips? Efficiency not a concern since I have bags of time spare

  • Custom User Avatar

    Reading the solutions for this when compared to my, uhh, naive method was a trip. Nice kata, thoroughly enjoyed

  • Custom User Avatar

    Ohh I didn't know to check the node version... silly me.
    Thanks for the heads up - I will do a manual implementation

  • Custom User Avatar

    It is not banned, but note the language version used. This kata currently only supports Node 8, and Array.flat wasn't added to node until version 11.

  • Custom User Avatar

    I only use it once per puzzle so I could just manually impliment it, but it seems odd for sure

  • Custom User Avatar

    Am I crazy, is Array.flat() banned? If so, why? Code including .flat() that executes in node or in console won't on here

  • Custom User Avatar

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

  • Custom User Avatar

    I think that there's more solution based on another paper (or at least mine and monadius' is, which makes it two :) ). I am not sure why, is it more googleable, or what. I think I've seen the one you used but I found the other one easier to implement.

  • Custom User Avatar

    I thought my solution was super janky but once I got it working it was under 2.0s.

    Did I just stumble upon a cracked algorithm in my research?

    Reading through other solutions and there's fancy stuff going on I don't begin to understand... to MDN I go :)

  • Custom User Avatar

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

  • Custom User Avatar

    description updated

  • Custom User Avatar

    I was thinking the same thing. An example would help quite a bit.

  • Custom User Avatar

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

  • Custom User Avatar

    There's a typo in the description. It says weekdays for 2 points near the end, rather than weekends for 2 points.
    Also I think it could use an example of the inputs and outputs, maybe something like:
    "
    E.g:
    Say the course has 3 recruits, Andy, Beth, and Charlie. The schedule might look something like [Andy, Charlie, Charlie, Beth, ...]
    "
    Or something like that idk. Might just have been me but I wasn't sure what it wanted so I started reading the sample tests and thought for a minute that the names were assumed to be a0, a1, a2 etc.
    Thoughts? Edit: Sorry the formatting on this comment is awful, I have no idea how to add newlines here

  • Loading more items...