Solves the classic lightbulbs puzzle