RAZORPAY | Maximum Score After Splitting a String | On-Campus OA (2024)
Razorpay · Question · Posted Jun 2026
Problem Statement Given a binary string s, split it into two non-empty parts: a left substring and a right substring. The score of a split is defined as: (Number of '0's in the left substring) + (Number of '1's in the right substring) Return the maximum possible score among all valid splits. A split must leave at least one character in both the left and right parts. Example 1 Input s = "011101" Output 5 Explanation Possible splits: 0 | ...
The full answer & interview discussion are available to premium members.
Log in Create a free account