1221. Split a String in Balanced Strings
Description
**Input:** s = "RLRRLLRLRL"
**Output:** 4
**Explanation:** s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'.**Input:** s = "RLLLLRRRLR"
**Output:** 3
**Explanation:** s can be split into "RL", "LLLRRR", "LR", each substring contains same number of 'L' and 'R'.**Input:** s = "LLLLRRRR"
**Output:** 1
**Explanation:** s can be split into "LLLLRRRR".ac
Last updated