int switches (int bulbs[]{ int n = bulbs.length; int c = 0; for(int i=0; i<n; i++){ if(bulbs[i] == c%2){ c=c+1; } } return c; }