Longest Subarray Length|| InterviewBit||Code Explanation + Approach

preview_player
Показать описание
Given an integer array A of size N containing 0's and 1's only.

You need to find the length of the longest subarray having count of 1’s one more than count of 0’s.

Note: In the subarray count of 1's should be one more than the count of 0's.

Input 1:

A = [0, 1, 1, 0, 0, 1]

Output 1:

5

Рекомендации по теме
Комментарии
Автор

This solution help me a lot thankyou sir 😊

ShubhanshuArya