Contiguous Array
MediumGiven a binary array, print the length of the longest contiguous subarray with the same number of 0s and 1s.
Input format:
- First line: n
- Second line: n values, each 0 or 1
Constraints
1 <= n <= 10^5 nums[i] is 0 or 1
1 <= n <= 10^5 nums[i] is 0 or 1