Available question text
Given an array, find the maximum Hamming distance between the array and any of its cyclic rotations — i.e., the largest number of indices i where A[i] != A[(i+shift) mod n] over all nonzero shifts. The challenge is to compute this efficiently for large n (avoid O(n^2) rotation comparisons) using string/array-matching techniques (concatenation + KMP/Z/rolling-hash) and careful handling of duplicates.
Related questions
Continue with questions that share topics or the same question type.
- All the Pairs With the Maximum Number of Common Followers
Coding
- Average Salary Excluding the Minimum and Maximum Salary
Coding
- Binary Tree Maximum Path Sum
Coding · Binary Tree · Depth-First Search · DP on Trees
- Build Array Where You Can Find The Maximum Exactly K Comparisons
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 3141. Maximum Hamming Distances
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source