Skip to content

Commit 8744205

Browse files
committed
Time: 0 ms (100.00%) | Memory: 7.8 MB (46.37%) - LeetSync
1 parent 651b349 commit 8744205

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution {
2+
public:
3+
int commonFactors(int a, int b) {
4+
int count=0;
5+
int m= max(a,b);
6+
for(int i=1; i<=m; i++)
7+
{
8+
if(a%i==0 && b%i==0)
9+
count ++;
10+
}
11+
return count;
12+
}
13+
};

0 commit comments

Comments
 (0)