You are given a string s of length n containing only 'Q', 'W', 'E', and 'R'.
A string is said to be balanced if each of its characters appears n/4 times.
Return the minimum length of the substring that can be replaced with any other characters of the same length to make s balanced.
- A string
s.
Input: s = "QWER"
Output: 0
Input: s = "QQWE"
Output: 1
Explanation: Replace one 'Q' with 'R'.