Skip to content

Commit 88ed746

Browse files
add 3162
1 parent ce3900a commit 88ed746

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|---------------------------------|----------------------------------------------------------------------
11+
| 3162 |[Find the Number of Good Pairs I](https://leetcode.com/problems/find-the-number-of-good-pairs-i/)| [Java](../master/src/main/java/com/fishercoder/solutions/_3162.java) | | Easy |
1112
| 3131 |[Find the Integer Added to Array I](https://leetcode.com/problems/find-the-integer-added-to-array-i/)| [Java](../master/src/main/java/com/fishercoder/solutions/_3131.java) | | Easy |
1213
| 3127 |[Make a Square with the Same Color](https://leetcode.com/problems/make-a-square-with-the-same-color/)| [Java](../master/src/main/java/com/fishercoder/solutions/_3127.java) | | Easy |
1314
| 3120 |[Count the Number of Special Characters I](https://leetcode.com/problems/count-the-number-of-special-characters-i/)| [Java](../master/src/main/java/com/fishercoder/solutions/_3120.java) | | Easy |

Diff for: src/main/java/com/fishercoder/solutions/_3162.java

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _3162 {
4+
public static class Solution1 {
5+
public int numberOfPairs(int[] nums1, int[] nums2, int k) {
6+
int count = 0;
7+
for (int i = 0; i < nums1.length; i++) {
8+
for (int j = 0; j < nums2.length; j++) {
9+
if (nums1[i] % (nums2[j] * k) == 0) {
10+
count++;
11+
}
12+
}
13+
}
14+
return count;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)