Skip to content

Commit a27e39b

Browse files
rename a varaible in 1377
1 parent f92662a commit a27e39b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/java/com/fishercoder/solutions/_1377.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ public double frogPosition(int n, int[][] edges, int t, int target) {
6767
for (int i = queue.size(); i > 0; i--) {
6868
int vertex = queue.poll();
6969
int nextVerticesCount = 0;
70-
for (int v : graph[vertex]) {
71-
if (!visited[v]) {
70+
for (int next : graph[vertex]) {
71+
if (!visited[next]) {
7272
nextVerticesCount++;
7373
}
7474
}
75-
for (int v : graph[vertex]) {
76-
if (!visited[v]) {
77-
visited[v] = true;
78-
queue.offer(v);
79-
probabilities[v] = probabilities[vertex] / nextVerticesCount;
75+
for (int next : graph[vertex]) {
76+
if (!visited[next]) {
77+
visited[next] = true;
78+
queue.offer(next);
79+
probabilities[next] = probabilities[vertex] / nextVerticesCount;
8080
}
8181
}
8282
if (nextVerticesCount > 0) {

0 commit comments

Comments
 (0)