My LeetCode grinding. Trying to do a problem a day.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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.