| AlgoChief Sprint Round 3 |
|---|
| Finished |
Sanjay has an undirected tree with $$$n$$$ nodes, where each node is labeled from $$$1$$$ to $$$n$$$. Each node $$$u$$$ also has an associated integer value $$$val_u$$$. For each node $$$u$$$, determine the shortest distance to a node $$$v$$$ $$$(v \neq u)$$$ such that:$$$ \implies $$$ ($$$val_u$$$ $$$\&$$$ $$$val_v$$$) $$$ \neq $$$ $$$max(val_u , val_v)$$$.
___________________________________________________________
263 7 2 5 8 11 22 33 44 55 652 2 2 2 25 34 32 51 2
1 1 1 1 1 1 -1 -1 -1 -1 -1
| Name |
|---|


