DP

We can compute the solution from the bottom-up, computing the numbers for entries “higher” in the DP table.

Graphs

You needed to do binary search over the connected components at time t to find the lowest time with enough CCs.

This works because the number of connected components is increasing.