You are given a string s consisting only of the characters 'L' and 'R'.
A balanced string is defined as one that contains an equal number of 'L' and 'R' characters.
Your task is to split the given string into the maximum number of balanced substrings, and return this number.
Each substring after splitting must be balanced on its own.
Input: s = "RLRRLLRLRL"
Output: 4
Input: s = "RLRRRLLRLL"
Output: 2
Accepted:
Submission: