Make a Tree
We initially have an graph $G$ with $N$ nodes and $0$ edges, and we will perform colouring operations on it. In each colouring operation, we choose an array $C = [C_1, C_2, .... C_N] (1 \le C_i \le N)$ and do the following : - For all $(i, j)$ such that $1 \le i < j \le N$ and $C_i = C_j$, if the edge $(i, j)$ does not already exist in $G$, add it to the graph $G$. We want to convert the grap
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start