lamps lamps is numbered 1 to lamps, and all of them start lit. A panel has four buttons, each toggling its own group of lamps:
- **A**: every lamp;
- **B**: the even-numbered lamps;
- **C**: the odd-numbered lamps;
- **D**: lamps 1, 4, 7, 10, … (numbers that leave remainder 1 when divided by 3).
You make exactly presses presses, picking any button each time (the same button may be pressed again). Return how many different on/off patterns of the row you can end up with.lamps=2, presses=1 → 3
Button A gives [off, off], button B gives [on, off], button C gives [off, on], button D gives [off, on]. That is three distinct states.
lamps=1, presses=0 → 1
No button is pressed, the lamp stays on: one state.
lamps=3, presses=2 → 7
lamps=2, presses=1
3
Run checks the first 3 tests in your browser. Submit checks all 93 tests on the server, hidden ones included.