there n computer number 0 n 1 connect ethernet cable connection form network connectionsi ai bi represent connection computer ai bi any computer reach computer directly indirectly networkyou give initial computer network connection you extract certain cable directly connect computer place pair disconnected computer directly connectedreturn minimum number time need order computer connect if possible return 1 Example 1input n 4 connection 010212output 1explanation Remove cable computer 1 2 place computer 1 3example 2input n 6 connection 0102031213output 2example 3input n 6 connection 01020312output 1explanation there cable Constraints1 n 1051 connectionslength minn n 1 2 105connectionsilength 20 ai bi nai biThere repeat connectionsno computer connect cable