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 b622b05 commit 5a8b4e3Copy full SHA for 5a8b4e3
src/main/java/g3501_3600/s3558_number_of_ways_to_assign_edge_weights_i/Solution.java
@@ -15,7 +15,7 @@ public int assignEdgeWeights(int[][] edges) {
15
int n = edges.length + 1;
16
List<List<Integer>> adj = new ArrayList<>();
17
for (int i = 0; i <= n; i++) {
18
- adj.add(new ArrayList<Integer>());
+ adj.add(new ArrayList<>());
19
}
20
for (int[] i : edges) {
21
adj.get(i[0]).add(i[1]);
@@ -24,7 +24,7 @@ public int assignEdgeWeights(int[][] edges) {
24
int[] l = new int[n + 1];
25
int max = 0;
26
Arrays.fill(l, -1);
27
- Queue<int[]> q = new LinkedList<int[]>();
+ Queue<int[]> q = new LinkedList<>();
28
q.offer(new int[] {1, 0});
29
l[1] = 0;
30
while (!q.isEmpty()) {
0 commit comments