GoLang Solution For LeetCode Problem: Perfect Number
Solving Perfect Number in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Now, given an
n, write a function that returns true when it is a perfect number and false when it is not.
Input: 28 Output: True Explanation: 28 = 1 + 2 + 4 + 7 + 14
See the full details of the problem Perfect Number at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go