天天看点

1221. Split a String in Balanced Strings

Balanced strings are those who have equal quantity of 'L' and 'R' characters.

Given a balanced string <code>s</code> split it in the maximum amount of balanced strings.

Return the maximum amount of splitted balanced strings.

Example 1:

Example 2:

Example 3:

Example 4: