My LeetCode grinding. Trying to do a problem a day.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415
  1. Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1.
  2. Example 1:
  3. Input: [0,1]
  4. Output: 2
  5. Explanation: [0, 1] is the longest contiguous subarray with equal number of 0 and 1.
  6. Example 2:
  7. Input: [0,1,0]
  8. Output: 2
  9. Explanation: [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1.
  10. Note: The length of the given binary array will not exceed 50,000.