Skip to content

Commit e5d9047

Browse files
authored
Create 2427. Number of Common Factors
1 parent 3b77665 commit e5d9047

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

2427. Number of Common Factors

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

0 commit comments

Comments
 (0)