LeetCode
Flip Game
Click
here
for an explanation.