Bulb Switcher III(LeetCode 1375):

Problem