Problem 839 · Hard

Similar String Groups

Group strings that can become equal after a single swap of two letters and count the connected groups. The visual draws strings as nodes and merges components with union-find.

Open the interactive visualisation