Google's datacenter management system represents physical server racks as a 2D grid. After a switch failure, the network partitioned into isolated islands of servers. Each island requires a separate VLAN configuration and independent monitoring. The operations team needs an automated count of network partitions before dispatching field engineers.
Our datacenter is represented as a 2D grid. `1` represents an active server rack, `0` represents an empty aisle. An "island" is a cluster of connected servers. Due to a switch failure, the network partitioned. Count how many isolated server clusters exist.
βΆ Run Code to test against examples Β· Submit to judge all 5 test cases