bits made of 0 and 1. Cut it in one place into two non-empty parts, a left one and a right one.
The cut scores the number of zeros in the left part plus the number of ones in the right part. Return the highest score you can get.bits='010011' → 5
Cut after "0100": three zeros on the left and two ones on the right, 5 in total. Nothing scores higher.
bits='000' → 2
There are no ones, and the right part cannot be empty, so the left part holds at most two zeros.
bits='10' → 0
bits contains only the characters 0 and 1bits='010011'
5
Run checks the first 3 tests in your browser. Submit checks all 146 tests on the server, hidden ones included.