My LeetCode grinding. Trying to do a problem a day.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

problem.txt 423B

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.