1234. Replace the Substring for Balanced String
Description
**Input:** s = "QWER"
**Output:** 0
**Explanation:** s is already balanced.**Input:** s = "QQWE"
**Output:** 1
**Explanation:** We need to replace a 'Q' to 'R', so that "RQWE" (or "QRWE") is balanced.**Input:** s = "QQQW"
**Output:** 2
**Explanation:** We can replace the first "QQ" to "ER". ac
Last updated