Can we apply heavy light decomposition?
Can HLD solve 1328E problem?
@begginner_cp you can solve this question using lowest common ancestor no need of hld
simply sort the nodes in according to their heights and then try to solve using their lca and if still not solved let me know
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.