Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3052825

Browse files
add 2427
1 parent 0adbbb0 commit 3052825

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------------------------------|-------------
11-
| 2432 |[The Employee That Worked on the Longest Task](https://leetcode.com/problems/the-employee-that-worked-on-the-longest-task/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2432.java) || Easy ||
11+
| 2432 |[The Employee That Worked on the Longest Task](https://leetcode.com/problems/the-employee-that-worked-on-the-longest-task/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2432.java) || Easy ||
12+
| 2427 |[Number of Common Factors](https://leetcode.com/problems/number-of-common-factors/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2427.java) || Easy ||
1213
| 2399 |[Check Distances Between Same Letters](https://leetcode.com/problems/check-distances-between-same-letters/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2399.java) || Medium ||
1314
| 2395 |[Find Subarrays With Equal Sum](https://leetcode.com/problems/find-subarrays-with-equal-sum/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2395.java) || Easy ||
1415
| 2380 |[Time Needed to Rearrange a Binary String](https://leetcode.com/problems/time-needed-to-rearrange-a-binary-string/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2380.java) || Medium ||
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2427 {
4+
public static class Solution1 {
5+
public int commonFactors(int a, int b) {
6+
int ans = 1;
7+
int num = 2;
8+
while (num <= a && num <= b) {
9+
if (a % num == 0 && b % num == 0) {
10+
ans++;
11+
}
12+
num++;
13+
}
14+
return ans;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)