Official algorithmic problem description and constraints.
There are π islands, numbered 1,2,β¦,π. Initially, every pair of islands is connected by a bridge. Hence, there are a total of π(πβ1)/2 bridges.
Everule lives on island 1 and enjoys visiting the other islands using bridges. Dominater has the power to destroy at most π bridges to minimize the number of islands that Everule can reach using (possibly multiple) bridges.
Find the minimum number of islands (including island 1) that Everule can visit if Dominater destroys bridges optimally.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.