# Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1. # if exist, then calculate the index difference, that will be a candidate that has ...
Create an array prefix_sum where each entry at index i stores the sum of all elements from the start up to index i. This can be computed as: prefix_sum[i]=prefix_sum[i−1]+nums[i] (ii) Answer Queries ...