Search
⌘K

Leetcode 2157. Groups of Strings

Treat each string (letters are unique) as a 26-bit mask and connect two masks if one can be obtained from the other by adding or removing one bit or by replacing one bit (i.e., one-bit edit on the set). The task is to compute the number of connected components and the size of the largest component — typically solved by generating mask transformations and using union-find or graph traversal.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.