Skip to content

Commit 1cbb09c

Browse files
committed
Runtime: 4252 ms (Top 41.99%) | Memory: 42.1 MB (Top 50.71%)
1 parent 57ed902 commit 1cbb09c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
/**
1+
// Runtime: 4252 ms (Top 41.99%) | Memory: 42.1 MB (Top 50.71%)
2+
/**
23
* @param {number} num
34
* @return {boolean}
45
*/
56
var checkPerfectNumber = function(num) {
6-
let total = 0
7+
let total = 0
78

8-
for(let i = 1 ; i < num;i++){
9-
if(num % i == 0){
10-
total += i
11-
}
12-
}
13-
return total == num ? true : false
9+
for(let i = 1 ; i < num;i++){
10+
if(num % i == 0){
11+
total += i
12+
}
13+
}
14+
return total == num ? true : false
1415
};

0 commit comments

Comments
 (0)