HTMLify
LeetCode - Maximum Score After Splitting a String - Python
Views: 348 | Author: abh
1 2 3 4 5 6 7 8 9 10 | class Solution: def maxScore(self, s: str) -> int: maxscore = 0 for i in range(1, len(s)): l = s[:i] r = s[i:] score = l.count("0") + r.count("1") if score > maxscore: maxscore = score return maxscore |