n
to a maximum of 3, as any larger number will not increase the number of unique states.presses
to a maximum of 3 for the same reason.presses
is 0, return 1 because there is only one state (all lights on).n
is 1, return 2 if presses
is at least 1 because there are only two states (on or off).n
is 2, return 3 if presses
is 1, or 4 if presses
is greater than 1.n
is 3, return 4 if presses
is 1, 7 if presses
is 2, or 8 if presses
is greater than 2.