Maximum Score After Splitting a String Problem

Maximum Score After Splitting a String Problem — ExecCode Easy DSA Practice

Solve the Maximum Score After Splitting a String problem on ExecCode. Free online easy DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. Your task is to 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. Return the required answer exactly as shown in the examples.

Examples

Input {"s": "011101"}; Output 5. Input {"s": "00111"}; Output 5

Constraints

2 <= s.length <= 500 The string s consists of characters '0' and '1' only.

Practice Maximum Score After Splitting a String free on ExecCode. Browse DSA problems, topic map, and placement guides.