Available question text
Given equal-length anagram strings, group them into connected components where an edge connects two strings if they are identical or can be made equal by swapping two letters (i.e., they differ in at most two positions). Return the number of such similarity groups — typically found by building this graph with pairwise O(L) checks and counting components (DFS/union-find).
Related questions
Continue with questions that share topics or the same question type.
- Divide a String Into Groups of Size k
Coding
- First Round OA - 4 LC Questions
First two very easy.
Last two were pretty hard.
Second Last question was a leetcode hard of String Manipulation
and last question was also similar to a leetcode hard of a graphs question
Coding
- Minimum Length of String After Deleting Similar Ends
Coding
- A Graph question, a string question, a couple of array questions.
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 839. Similar String Groups
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source