Question: in python plz asap Question 2 Max. score: 20.00 A binary array You are given a binary array A. A binary array contains only 0
Question 2 Max. score: 20.00 A binary array You are given a binary array A. A binary array contains only 0 and 1 (1-based indexing). You can perform the following operation at most one times. Change an array element from 1 to 0 . You are required to maximize the number of subarrays that contain at least one 0 and find the number of such subarrays that contain at least one 0 . Input format - The first line contains T denoting the number of test cases. - The first line of each test case contains N denoting the size of the binary array. - The next line of each test case contains N space-separated integers denoting array elements. Output format Print the maximum number of subarrays which will contain at least one 0 in a new line. Constraints
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
