Maximum Difference of 0s and 1s in a Binary String | Kadane’s Algorithm

Given a binary string s consisting of 0s and 1s. Find the maximum difference of the number of 0s and the number of 1s (number of 0s – number of 1s) in a substring of the string. Note: In the case of all 1s, the answer will be -1.