Equal 0s and 1s

0

0 votes
Easy
Problem

Given an array of 0's and 1's. Write a program which print the size of the largest contiguous sub array with equal number of 0's and 1's .

Input

The first line of input is a number N denoting the size of the array and in the next line are N space separated values of A [ ].

Output

Print the length of max contiguous subarray.

0 < N < 100000

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?