FastPrepWords with Repeated Anagrams
Problems/Words with Repeated Anagrams

Words with Repeated Anagrams

The Voleon Group logoThe Voleon Group● EasyFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: The report directly asks for the words in a list whose anagram occurs more than once. The practice contract explicitly preserves input order and duplicate occurrences.

Given an array of lowercase words, return every input word whose letters can be rearranged to form at least one other word at a different input index.

Preserve the original input order and occurrences. Equal strings at different indices count as anagram partners.

Function

wordsWithRepeatedAnagrams(words: String[]) → String[]

Examples

Example 1

words = ["listen","silent","cat","tac","dog"]return = ["listen","silent","cat","tac"]

The first two and middle two words form repeated anagram groups.

Example 2

words = ["aa","aa","b"]return = ["aa","aa"]

Equal occurrences at different indices are partners.

Constraints

  • 0 <= words.length <= 100000.
  • 1 <= words[i].length <= 100.
  • Words contain lowercase English letters.

More The Voleon Group problems

  • Best-Fit Plane Normal from 3D PointsPHONE SCREEN · Seen Sep 2026
  • Count Palindromic SubstringsPHONE SCREEN · Seen Aug 2026
See The Voleon Group hiring insights
Saved
class Solution {
    public String[] wordsWithRepeatedAnagrams(String[] words) {
        // Write your solution here.
    }
}
Checking account…