1221. Split a String in Balanced Strings
https://leetcode.com/problems/split-a-string-in-balanced-strings
Description
Balanced strings are those that have an equal quantity of 'L'
and 'R'
characters.
Given a balanced string s
, split it in the maximum amount of balanced strings.
Return the maximum amount of split balanced strings.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= s.length <= 1000
s[i]
is either'L'
or'R'
.s
is a balanced string.
ac
Last updated