Longest Subarray with Equal 0s and 1s Using Hash Map

Given a binary array (containing only 0s and 1s), find the length of the longest contiguous subarray with equal number of 0s and 1s.

Difficulty:

Console