Available question text
Given a string of only 'Q','W','E','R', find the minimum-length substring that can be replaced so each character appears exactly n/4 times. This reduces to finding the smallest window whose removal makes every character's count ≤ n/4, typically solved with frequency counts and a two-pointer sliding-window.
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 1234. Replace the Substring for Balanced String
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source