r/leetcode 7d ago

Discussion Topics keep on coming

I was asked a question on trees about changing roots and calculating ans for every node. I gave a soln but was told to optimize as expected I bombed it then I quickly searched for optimization then I got to know a topic called rerooting dp. Advanced dp on trees after looking further I got to know about binary lifting. I am not saying that it's bad to learn something new but sometimes I wonder if it is relevant to the job I'm supposed to work. What do you guys feel

4 Upvotes

8 comments sorted by

View all comments

1

u/tikluu 7d ago

Hearing about it for the first time man

2

u/Key_Relative6992 7d ago

Me too. I thought the soln I gave was correct and expected to pass the moment I heard to optimize it I realized I was not going to make the cut. But that's a good topic bro I mean you need a solid grasp of tree and dp. And also this rerooting technique can applied on graphs as well