Finding Largest Subarray with equal no of zeros and ones

Since this problem can be solved using hashing and sliding window technique here are steps to to follow for this type of problem:

1.iterate the array and update the array with -1 where zeros exist so that we can make the sum to zero in a window and this way we can keep track windows which make zero sum subarray and can find the window size.

2.use map data structures to keep track of position of sum till that index and whenever the sum repeats it means we got the answer and we need to calculate the length which give us the subarray with equal no of ones and zeros and if it don’t repeats means we need to update the map up to that index sum with current index.