WA on find the special Node

https://www.codechef.com/viewsolution/53996328