couldn't understand logic of taking max(it1+1, it2) could you make it more simple.
lest take an example of a tree with three child and k = 4. each child return (1 → 2) so answer is 18 but by doing your logic calculation 26.
Read more… (44 words)
couldn't understand logic of taking max(it1+1, it2) could you make it more simple.
lest take an example of a tree with three child and k = 4. each child return (1 → 2) so answer is 18 but by doing your logic calculation 26.
Hi, In the codechef there is condition i < j ? could you explain after sorting how it is still valid i < j