I applied directly
Received a OA link -
it has 3 questions
Part 1 - Given an binary array containing only 0 and 1 find the length of longest contiguous subarray in which the number of 0s and 1s is equal Ex =[0,1,0,0,1,1,0] answer is 6
Part 2 - Now, you may flip at most one element in the array change a 0 to 1 or a 1 to 0 find the length of the longest subarray where the number of 0s equal the number of 1s after performing at most one flip Ex [0,1,0,0,1,1,0,0] ans is 8Part 3 - For the final task, find the length of the longest subarray with an equal number of 0s and 1s such that every prefix of that subarray has the count of 1s greater than or equal to the count of 0s
Return the max length of a subarray that satisfies all the condition
Ex - [1,0,1,1,0,0,1] ans is 6After this AI asked me some questions
