Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Brilliant solution. It uses a arithmetic series formula to directly compute the sum of all multiples of 3 or 5 below a given number.

    Moral of the Story: Regardless how much we practiced in DSA, if we neglect the training on our math intuition, we will totally misses the chance to convert our code into O(1)!

  • Custom User Avatar

    When you spent 40 minutes creating a recursive method because you saw the word "Recursive sum"...
    .
    .
    .
    .

    And you saw others solved it with the math approach using 1 liner..

    dude (;-;)/