The last contest of CodeChef ([this one](https://www.codechef.com/CSNS21A)) had 2 rerooting problems and it wasn't really solved by many people(even in Div1), so I figured it's something not many people know.↵
↵
So I have made a tutorial video on the same: https://www.youtube.com/watch?v=7_huTWwl5jM&ab_channel=CMC↵
↵
↵
In it I discuss:↵
↵
- How to identify which problem requires this↵
↵
- How to go about solving it↵
↵
- How to implement without much hassle↵
↵
- Some problems that require it and their solution/hint↵
↵
↵
When I first came up with this rerooting my implementation was pretty terrible but now it's much better IMO, so I also wanted to share it.↵
↵
↵
![ ](https://media.discordapp.net/attachments/887220616170704918/906155039586910248/New_Project_3.png)
↵
So I have made a tutorial video on the same: https://www.youtube.com/watch?v=7_huTWwl5jM&ab_channel=CMC↵
↵
↵
In it I discuss:↵
↵
- How to identify which problem requires this↵
↵
- How to go about solving it↵
↵
- How to implement without much hassle↵
↵
- Some problems that require it and their solution/hint↵
↵
↵
When I first came up with this rerooting my implementation was pretty terrible but now it's much better IMO, so I also wanted to share it.↵
↵
↵
![ ](https://media.discordapp.net/attachments/887220616170704918/906155039586910248/New_Project_3.png)