Skip to content

Commit 483e69d

Browse files
add 1995
1 parent f9d3036 commit 483e69d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

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+
|1995|[Count Special Quadruplets](https://leetcode.com/problems/count-special-quadruplets/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1995.java) ||Easy||
1112
|1992|[Find All Groups of Farmland](https://leetcode.com/problems/find-all-groups-of-farmland/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1992.java) ||Medium||
1213
|1991|[Find the Middle Index in Array](https://leetcode.com/problems/find-the-middle-index-in-array/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1991.java) ||Easy||
1314
|1985|[Find the Kth Largest Integer in the Array](https://leetcode.com/problems/find-the-kth-largest-integer-in-the-array/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1985.java) ||Medium||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _1995 {
4+
public static class Solution1 {
5+
public int countQuadruplets(int[] nums) {
6+
int count = 0;
7+
for (int i = 0; i < nums.length - 3; i++) {
8+
for (int j = i + 1; j < nums.length - 2; j++) {
9+
for (int k = j + 1; k < nums.length - 1; k++) {
10+
for (int l = k + 1; l < nums.length; l++) {
11+
if (nums[i] + nums[j] + nums[k] == nums[l]) {
12+
count++;
13+
}
14+
}
15+
}
16+
}
17+
}
18+
return count;
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)