627

There is another solution using Linked List in case Router ID is not limited from 1 to 300. But for this problem this solution gets TLE.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *