Find the Length of the Longest Pair of Perfect Anagrams
Find the length of the longest pair of perfect anagrams from the substrings of a given string. Perfect anagrams are defined as words with equal letter counts but different arrangements. For example, given s = 'abcacb', the longest pair is ('bcac', 'cacb') with length 4. Constraint: 1 <= len(s) <= 10^5.
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early October, 2024
Amazon
Junior
Find the length of the longest pair of perfect anagrams from the substrings of a given string. Perfect anagrams are defined as words with equal letter counts but different arrangements. For example, given s = 'abcacb', the longest pair is ('bcac', 'cacb') with length 4. Constraint: 1 <= len(s) <= 10^5.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.