Skip to content

Commit f01dcc8

Browse files
authored
Update 1514-path-with-maximum-probability.kt
1 parent cd54717 commit f01dcc8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kotlin/1514-path-with-maximum-probability.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ class Solution {
1717
add(start to 1.0)
1818

1919
while (isNotEmpty()) {
20-
val (node, currCost) = poll()
20+
val (node, currProb) = poll()
2121
visited.add(node)
2222

23-
if (node == end) return currCost
23+
if (node == end) return currProb
2424

2525
adj[node]?.forEach {
2626
if (it.first !in visited) {
27-
add(it.first to currCost * it.second)
27+
add(it.first to currProb * it.second)
2828
}
2929
}
3030
}

0 commit comments

Comments
 (0)