We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adfbec5 commit 7b48aa4Copy full SHA for 7b48aa4
src/main/java/g3201_3300/s3267_count_almost_equal_pairs_ii/Solution.java
@@ -11,10 +11,10 @@
11
public class Solution {
12
public int countPairs(int[] nums) {
13
int pairs = 0;
14
- Map<Integer, Integer> counts = new HashMap<Integer, Integer>();
+ Map<Integer, Integer> counts = new HashMap<>();
15
Arrays.sort(nums);
16
for (int num : nums) {
17
- Set<Integer> newNums = new HashSet<Integer>();
+ Set<Integer> newNums = new HashSet<>();
18
newNums.add(num);
19
for (int unit1 = 1, remain1 = num; remain1 > 0; unit1 *= 10, remain1 /= 10) {
20
int digit1 = num / unit1 % 10;
0 commit comments