• + 1 comment

    If sqrt is a divisor, we end up counting it twice. We do sum -=sqrt to basically remove the double-count we did earlier.

    HackerRank solutions.