Skip to content

Commit a935f68

Browse files
committed
Runtime: 4 ms (Top 11.09%) | Memory: 6.90 MB (Top 9.31%)
1 parent b3f28c7 commit a935f68

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Runtime: 4 ms (Top 11.09%) | Memory: 6.90 MB (Top 9.31%)
2+
3+
class Solution {
4+
public:
5+
unordered_set<int> s;
6+
int distinctIntegers(int n) {
7+
s.insert(n);
8+
for(int i = 2; i < n; ++i) {
9+
if(n%i == 1 && s.find(i) == s.end()) distinctIntegers(i);
10+
}
11+
return s.size();
12+
}
13+
};

0 commit comments

Comments
 (0)