Skip to content

Commit fedb25a

Browse files
committed
Fixed sonar
1 parent ded7209 commit fedb25a

File tree

1 file changed

+2
-3
lines changed
  • src/main/java/g3401_3500/s3419_minimize_the_maximum_edge_weight_of_graph

1 file changed

+2
-3
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
@@ -10,7 +10,6 @@
1010

1111
@SuppressWarnings({"unchecked", "unused", "java:S1172"})
1212
public class Solution {
13-
private ArrayList<ArrayList<Pair>> adj;
1413
private ArrayList<ArrayList<Pair>> revadj;
1514

1615
private static class Pair {
@@ -24,7 +23,7 @@ public Pair(int node, int weight) {
2423
}
2524

2625
public int minMaxWeight(int n, int[][] edges, int threshold) {
27-
adj = new ArrayList<>();
26+
ArrayList<ArrayList<Pair>> adj = new ArrayList<>();
2827
revadj = new ArrayList<>();
2928
for (int i = 0; i <= n + 1; i++) {
3029
adj.add(new ArrayList<>());
@@ -45,7 +44,7 @@ public int minMaxWeight(int n, int[][] edges, int threshold) {
4544
dist[0] = 0;
4645
Queue<Pair> q = new LinkedList<>();
4746
q.offer(new Pair(0, 0));
48-
while (q.size() > 0) {
47+
while (!q.isEmpty()) {
4948
int u = q.peek().node;
5049
int currMax = q.peek().weight;
5150
q.poll();

0 commit comments

Comments
 (0)