1422. Maximum Score After Splitting a String
https://leetcode.com/problems/maximum-score-after-splitting-a-string
Description
Given a string s
of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring).
The score after splitting a string is the number of zeros in the left substring plus the number of ones in the right substring.
Example 1:
Example 2:
Example 3:
Constraints:
2 <= s.length <= 500
The string
s
consists of characters'0'
and'1'
only.
ac
Last updated