C# - I ran both to see if this was significant. And the OJ results are so inconsistent that it was hard to say for sure, although it did seem the array version was slightly faster. The array version has to be faster but also uses more memory so not sure overall which is better.

public int FindMaxLength(int[] nums)
{
int[] map = new int[2 * (nums.Length + 1)];
int mid = map.Length / 2;
int max = 0;
int delta = 0;
for (int i = 0; i < nums.Length; i++)
{
delta += nums[i] == 0 ? -1 : 1;
if (delta == 0)
{
max = i + 1;
}
else if (map[mid + delta] == 0)
{
map[mid + delta] = i + 1; // use 0 as not-set
}
else if (max < i + 1 - map[mid + delta])
{
max = i + 1 - map[mid + delta];
}
}
return max;
}

with Map

public int FindMaxLength(int[] nums)
{
Dictionary<int,int> map = new Dictionary<int,int>();
int max = 0;
int delta = 0;
for (int i = 0; i < nums.Length; i++)
{
delta += nums[i] == 0 ? -1 : 1;
if (delta == 0)
{
max = i + 1;
}
else if (!map.ContainsKey(delta))
{
map[delta] = i;
}
else if (max < i - map[delta])
{
max = i - map[delta];
}
}
return max;
}