Skip to content

Commit 4c9df6f

Browse files
committed
Fixed sonar
1 parent 0f0c836 commit 4c9df6f

File tree

2 files changed

+4
-4
lines changed
  • src/main/java/g3401_3500

2 files changed

+4
-4
lines changed

src/main/java/g3401_3500/s3419_minimize_the_maximum_edge_weight_of_graph/Solution.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
import java.util.List;
99
import java.util.Queue;
1010

11-
@SuppressWarnings("unchecked")
11+
@SuppressWarnings({"unchecked", "unused", "java:S1172"})
1212
public class Solution {
1313
public int minMaxWeight(int n, int[][] edges, int threshold) {
14-
List<int[]>[] graph = new ArrayList[n];
1514
List<int[]>[] reversedG = new ArrayList[n];
1615
for (int i = 0; i < n; i++) {
1716
reversedG[i] = new ArrayList<>();
@@ -25,7 +24,7 @@ public int minMaxWeight(int n, int[][] edges, int threshold) {
2524
int[] distance = new int[n];
2625
Arrays.fill(distance, Integer.MAX_VALUE);
2726
distance[0] = 0;
28-
if (reversedG[0].size() == 0) {
27+
if (reversedG[0].size().isEmpty()) {
2928
return -1;
3029
}
3130
Queue<Integer> que = new LinkedList<>();

src/main/java/g3401_3500/s3420_count_non_decreasing_subarrays_after_k_operations/Solution.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public long countNonDecreasingSubarrays(int[] nums, long k) {
1515
}
1616
long res = 0;
1717
Deque<Integer> q = new ArrayDeque<>();
18-
for (int j = 0, i = 0; j < nums.length; ++j) {
18+
int i = 0;
19+
for (int j = 0; j < nums.length; ++j) {
1920
while (!q.isEmpty() && nums[q.peekLast()] < nums[j]) {
2021
int r = q.pollLast();
2122
int l = q.isEmpty() ? i - 1 : q.peekLast();

0 commit comments

Comments
 (0)