• + 1 comment
    class Calculator(AdvancedArithmetic):
        def divisorSum(self, n: int) -> int:
            if n < 2:
                return n
            divisors = [1, n]
            divisors.extend(filter(lambda x: n % x == 0, range(2, int(n / 2) + 1)))
            return sum(divisors)