Ad
  • Custom User Avatar

    This is genius :). I definitly didn´t think about flattening the structure and test the positions string-wise. Would you have documented your intention a bit I would have tagged as Best Practice, for sure.

    I only tagged as Clever because Genius doesn't exist ;).

  • Custom User Avatar

    Extremely fast solution. I found it to be the best mesh of code readability and speed (in my humble opinion).

  • Custom User Avatar

    I found this to be the fastest solution from all the ones I saw so far.

    I would definitely select it as best practice if it was more readable. If this was for a project, the code as-is is hard to read for newcomers, making it hard to maintain.

    Excellent reasoning.

  • Custom User Avatar

    I haven't laughed this hard reading code for a long time... and this time for the right reason :)

  • Custom User Avatar

    This is a very clever way of adding the multiples of 3 and 5 without repeating the common multiple. However I can't mark it as a best practice because it forces a traverse through all of the natural number (minus 1). If we're talking about a small input number it's negligeble, but if we're talking about a very high input number then it starts to take a toll.