Kth Ancestor of Tree Node
Given a rooted tree with `n` nodes and parent pointers, answer multiple queries for the k-th ancestor of a node. Precompute 2^j-th ancestors (binary lifting) for each node to answer each query in O(log n).
Given a rooted tree with `n` nodes and parent pointers, answer multiple queries for the k-th ancestor of a node. Precompute 2^j-th ancestors (binary lifting) for each node to answer each query in O(log n).