Skip to content

Commit e08bcb4

Browse files
committedJul 24, 2024·
add 2475
1 parent fef90ae commit e08bcb4

File tree

2 files changed

+22
-0
lines changed
  • paginated_contents/algorithms/3rd_thousand
  • src/main/java/com/fishercoder/solutions/thirdthousand

2 files changed

+22
-0
lines changed
 

‎paginated_contents/algorithms/3rd_thousand/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
| 2492 | [Minimum Score of a Path Between Two Cities](https://leetcode.com/problems/minimum-score-of-a-path-between-two-cities/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2492.java) || Medium | Union Find
4848
| 2487 | [Remove Nodes From Linked List](https://leetcode.com/problems/remove-nodes-from-linked-list/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2487.java) || Medium | LinkedList, Stack
4949
| 2485 | [Find the Pivot Integer](https://leetcode.com/problems/find-the-pivot-integer/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2485.java) || Easy ||
50+
| 2475 | [Number of Unequal Triplets in Array](https://leetcode.com/problems/number-of-unequal-triplets-in-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2475.java) || Easy ||
5051
| 2467 | [Convert the Temperature](https://leetcode.com/problems/convert-the-temperature/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2469.java) || Easy ||
5152
| 2465 | [Number of Distinct Averages](https://leetcode.com/problems/number-of-distinct-averages/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2465.java) || Easy ||
5253
| 2460 | [Apply Operations to an Array](https://leetcode.com/problems/apply-operations-to-an-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2460.java) || Easy ||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.fishercoder.solutions.thirdthousand;
2+
3+
public class _2475 {
4+
public static class Solution1 {
5+
public int unequalTriplets(int[] nums) {
6+
int triplets = 0;
7+
for (int i = 0; i < nums.length - 2; i++) {
8+
for (int j = i + 1; j < nums.length - 1; j++) {
9+
if (nums[i] != nums[j]) {
10+
for (int k = j + 1; k < nums.length; k++) {
11+
if (nums[i] != nums[k] && nums[j] != nums[k]) {
12+
triplets++;
13+
}
14+
}
15+
}
16+
}
17+
}
18+
return triplets;
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)
Please sign in to comment.