Space-efficient algorithm for finding the largest balanced subarray?
Now my algorithm is O(n) time and O(Dn) space where Dn is the total imblance in the list. This solution doesn’t modify the list. let D be the difference of 1s and 0s found in the list. First, let’s step linearily through the list and calculate D, just to see how it works: I’m gonna … Read more