1 line Python


  • 0
    return sum(i+num/i for i in range(1, int(math.sqrt(num))+1) if num % i == 0)-num == num if num > 1 else False

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.