Skip to content

Commit a488bf3

Browse files
authored
Fixed sonar warning.
1 parent 3e88eb9 commit a488bf3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/main/java/g2001_2100/s2013_detect_squares/DetectSquares.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ public int count(int[] point) {
3434
int x1 = diap[0];
3535
int y1 = diap[1];
3636
int num = diap[2];
37-
if (Math.abs(x - x1) != Math.abs(y - y1) || x == x1 || y == y1) {
38-
continue;
39-
} else {
37+
if (Math.abs(x - x1) == Math.abs(y - y1) && x != x1 && y != y1) {
4038
int p1hash = x * MUL + y1;
4139
int p2hash = x1 * MUL + y;
4240
if (map.containsKey(p1hash) && map.containsKey(p2hash)) {

src/main/java/g2001_2100/s2014_longest_subsequence_repeated_k_times/Solution.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55

66
import java.util.ArrayList;
77

8+
@SuppressWarnings("unchecked")
89
public class Solution {
910
public String longestSubsequenceRepeatedK(String s, int k) {
1011
char[] ca = s.toCharArray();
11-
1212
char[] freq = new char[26];
1313
for (char value : ca) {
1414
++freq[value - 'a'];
1515
}
16-
1716
ArrayList<String>[] cand = new ArrayList[8];
1817
cand[1] = new ArrayList<>();
1918
String ans = "";

0 commit comments

Comments
 (0)