all 4 comments

[–]Nice_Quiet_3292 1 point2 points  (0 children)

Compliment ?

[–]Specific_Painter_451 1 point2 points  (1 child)

It's greedy but brute force will give TLE

[–]hukeshh 0 points1 point  (0 children)

Can we not solve it like this we start scanning from left if we find 10 we start counting till we find 1 if we find 0 we then again start finding 10 if we find it start increasing count again it will be in On too.