My LeetCode grinding. Trying to do a problem a day.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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.