Tap here to switch tabs
Problem
Submissions

Problem: Split a String in Balanced Strings

Try to solve the Split a String in Balanced Strings problem.

Statement

Balanced strings are strings that contain an equal count of 'L' and 'R' characters.

Given a balanced string s, partition it into the maximum possible number of balanced substrings.

Return the maximum number of balanced substrings that can be obtained from the split.

Constraints:

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

  • s[i] is either 'L' or 'R'

  • s is a balanced string

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Split a String in Balanced Strings

Try to solve the Split a String in Balanced Strings problem.

Statement

Balanced strings are strings that contain an equal count of 'L' and 'R' characters.

Given a balanced string s, partition it into the maximum possible number of balanced substrings.

Return the maximum number of balanced substrings that can be obtained from the split.

Constraints:

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

  • s[i] is either 'L' or 'R'

  • s is a balanced string