Available question text
Find the maximum possible difference between counts of any two lowercase letters over all contiguous substrings of s — i.e., the largest (count(a) - count(b)) achievable in any substring. Key idea/pattern: treat each ordered pair of distinct letters and run a Kadane-like linear scan to maximize the difference while ensuring both letters appear in the substring (|s| up to 10^4).
Related questions
Continue with questions that share topics or the same question type.
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 2272. Substring With Largest Variance
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source