Problem in the sol

I am getting TLE in this question.
The link of my code :

Instead of node address compare its data.

Problem Still persists of TLE…