Ad
  • Custom User Avatar

    But what happened to n being "relatively small"?

    Seriously. The description makes it seem like the algorithmic complexity isn't a factor. I would have approached this problem completely differently if I'd known the "relatively small" n would timeout. A bit frustrating to be honest, especially considering how many comments are pointing this out.