Longest equal zero-one subarray
Your task
Given a binary array nums containing only 0s and 1s, return the length of the longest contiguous subarray that contains an equal number of 0s and 1s. If no such subarray exists, return 0. Here 1 <= len(nums) <= 10^5.
Examples
find_max_length(nums: list[int]) -> intExample 1
Input
find_max_length([0, 1, 0])Output
2