Kth Ancestor of a Tree Node
Precompute jumps of 1, 2, 4 and so on up the tree, then answer each query by combining the jumps that spell k in binary.
Precompute jumps of 1, 2, 4 and so on up the tree, then answer each query by combining the jumps that spell k in binary.