BULBS - Editorial

suppose LeftZ =10, rightz=9; v[0]=5
k is odd;

it will enter if (k % 2) condition and leftz will become 0, and k becomes even;

Now inside

		{
			offed += v[i];
			k -= 2;
			i++;
		}

only the v[] elements will be chosen and k will become 0

RightZ will be ignored

if(k!=0 && rightZ!=0) it wont enter this as k=0

Let me know if it made sense

Thanks for the help, I understood but i m unable to implement this.

can anyone help me undertanding why we do k/2 in setters solution ? in go function

means those who are getting the right output will get WA ?

No, who are are getting wrong output on some test cases is also get correct answer

Please help me with my BULBS code. i can’t find what is wrong with my code.
https://www.codechef.com/viewsolution/38165968

return min(solve1(s1, k) + cnt1 + cnt2, min(solve1(s1, k-1) + cnt1, min(solve1(s1, k-1) + cnt2, solve1(s1, k-2))));

Can anyone explain to me what does above return statement meant by in editorialist’s solution?

you got me with the thumbnail…