it is for that test case only , until the value of teeth connceted to that node doesn't updated by any other value.
means as the node connected to this teeth has updated it's teeth value then it will affect all of the connected teeth speed, so the speed changes everytime whenever type 2 query gets called.
as 123 nodes form a cycle ,so they all gets blocked by one another and hence now if we connect the node 4 to 1 it's speed is also zero because it is written in the question that if the new node is connected to the node which is already blocked then this blocked node will also block the new connected node and so the answer is zero.
@helpinghand
No, even cycle will never gets blocked , you have to keep track of odd cycle , this is main thing in the Gears problem. whenever you get odd cycle then all their connected nodes gets blocked and the new nodes which are going to connect with these nodes will also gets blocked.
OK.