Try it on GfG Practice Given an array arr[] containing only 0s and 1s, find the longest subarray which contains equal no of 0s and 1s. Examples: Input: arr[] = [1, 0, 1, 1, 1, 0, 0] Output: 6 Explanation: arr[1 ... 6] is the longest subarray with three 0s and three 1s. Input: arr[] = [0, 0, 1, 1, 0]…
2025
No articles.