N light bulbs are connected by a wire. Each bulb has a switch associated with it, however due to faulty wiring, a switch also changes the state of all the bulbs to the right of current bulb. Given an initial state of all bulbs, find the minimum number of switches you have to press to turn on all the bulbs. "0 represents the bulb is off and 1 represents the bulb is on."
The first line of input contains an integer T denoting the number of test cases.Each test case consists of number of bulbs N and the next line consist of the space separated state of N bulbs.
Print the minimum number of press required to turn on all the bulbs.
0 0 0 0
1 0 0 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.