Tap here to switch tabs
Problem
Submissions

Problem: Maximum Score After Splitting a String

med
30 min
Try to solve the Maximum Score After Splitting a String problem.

Statement

Given a string s consisting of zeros and ones, divide it into two non-empty substrings, left and right, such that their concatenation equals s.

The score of a split is defined as the total count of zeros in left plus the total count of ones in right.

Return the maximum score achievable across all possible splits.

Constraints:

  • 2≤2 \leq s.length ≤500\leq 500

  • s consists of characters '$0$' and '$1$' only.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Score After Splitting a String

med
30 min
Try to solve the Maximum Score After Splitting a String problem.

Statement

Given a string s consisting of zeros and ones, divide it into two non-empty substrings, left and right, such that their concatenation equals s.

The score of a split is defined as the total count of zeros in left plus the total count of ones in right.

Return the maximum score achievable across all possible splits.

Constraints:

  • 2≤2 \leq s.length ≤500\leq 500

  • s consists of characters '$0$' and '$1$' only.