Problem 863 · Medium

All Nodes Distance K in Binary Tree

Record parent links, then run a BFS outward from the target for k levels.

Open the interactive visualisation