Skip to content

Commit 5fdc09c

Browse files
add 2932
1 parent 1521278 commit 5fdc09c

File tree

2 files changed

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

2 files changed

+18
-0
lines changed

paginated_contents/algorithms/3rd_thousand/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| 2965 | [Find Missing and Repeated Values](https://leetcode.com/problems/find-missing-and-repeated-values/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2965.java) | | Easy |
77
| 2942 | [Find Words Containing Character](https://leetcode.com/problems/find-words-containing-character/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2942.java) | | Easy |
88
| 2937 | [Make Three Strings Equal](https://leetcode.com/problems/make-three-strings-equal/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2937.java) | | Easy |
9+
| 2932 | [Maximum Strong Pair XOR I](https://leetcode.com/problems/maximum-strong-pair-xor-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2932.java) | | Easy |
910
| 2928 | [Distribute Candies Among Children I](https://leetcode.com/problems/distribute-candies-among-children-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2928.java) | | Easy |
1011
| 2923 | [Find Champion I](https://leetcode.com/problems/find-champion-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2923.java) | | Easy |
1112
| 2917 | [Find the K-or of an Array](https://leetcode.com/problems/find-the-k-or-of-an-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2917.java) | | Easy |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fishercoder.solutions.thirdthousand;
2+
3+
public class _2932 {
4+
public static class Solution1 {
5+
public int maximumStrongPairXor(int[] nums) {
6+
int ans = 0;
7+
for (int i = 0; i < nums.length; i++) {
8+
for (int j = i; j < nums.length; j++) {
9+
if (Math.abs(nums[i] - nums[j]) <= Math.min(nums[i], nums[j])) {
10+
ans = Math.max(ans, nums[j] ^ nums[i]);
11+
}
12+
}
13+
}
14+
return ans;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)