LeetCode

Bulb Switcher II

Click here for an explanation.