LeetCode 525. Contiguous Array

Post by ailswan Apr. 26, 2024

525. Contiguous Array

Problem Statement

link: LeetCode.cn LeetCode Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1.

Example:

Input: nums = [0,1] Output: 2

Input: nums = [0,1,0] Output: 2

Solution Approach

Algorithm

Implement

    Class Solution:
    def findMaxLength(self, nums: List[int]) -> int: