The Question
CodingConsistent Parity Cycle Detection
Given an undirected graph with $n$ nodes and a sequence of weighted edges where weights are either 0 or 1, process the edges one by one in the given order. An edge is added to the graph if and only if its inclusion does not create any cycle with an odd sum of weights. Determine the total number of edges successfully added to the graph.
Java
DSU
XOR-Parity
Graph Theory