Lowest Common Ancestor from Serialized Tree
TikTok interview questions · Medium · Coding round · 6 tests
First rebuild the binary tree from preorder tokens, then run one DFS that counts how many target values each subtree contains.
The full question, tests and reference solution are available with a plan that includes TikTok.
Run your code with Ctrl+Enter to see results.