LeetCode 1221
-
[LeetCode/Python] 1221. Split a String in Balanced StringsAlgorithm/Leet Code 2020. 7. 12. 00:47
1221. Split a String in Balanced Strings Easy Balanced strings are those who have 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 splitted balanced strings. class Solution: def balancedStringSplit(self, s: str) -> int: length = len(s) result = 0 p = 0 for i in range(length) : if s[p:i+1].count('L..