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 5cc85c5 commit 472fb0cCopy full SHA for 472fb0c
src/main/kotlin/g3501_3600/s3585_find_weighted_median_node_in_tree/Solution.kt
@@ -131,7 +131,9 @@ class Solution {
131
var curr = v
132
for (p in longMax - 1 downTo 0) {
133
val nextNode = parent[p][curr]
134
- if (nextNode != -1 && depth[nextNode] >= depth[lca] && (dist[nextNode] - dist[lca]) >= remainingWeightFromLCA) {
+ if (nextNode != -1 && depth[nextNode] >= depth[lca] &&
135
+ (dist[nextNode] - dist[lca]) >= remainingWeightFromLCA
136
+ ) {
137
curr = nextNode
138
}
139
0 commit comments