Print the shortest path between two tree nodes using direction letters.
Unlock detailed company stats for this questionUpgrade
Given the root of a tree, a source node and a target node, find the shortest path from source to target and print the path using 'A' for moving to a left child, 'B' for a right child and 'C' for moving to the parent. Example: root 2 with children 1 and 4, src 1, target 4 -> output "CB".
Community answers
No answers contributed by the community yet.


