# How to write the classical algorithm for lights out problem?

I am very new to quantum computing and I have started learning the concepts watching the IBM summerschool videos and trying to solve the IBM quantum challenge problems. One of their problems is solving the lights out puzzle using grovers' algorithm. After learning Grover's algorithm I went through the example the did on sudoko here: https://qiskit.org/textbook/ch-algorithms/grover.html

There are three steps to solve a problem using Grovers' algorith :

1. Create a reversible classical circuit that identifies a correct solution

2. Use phase kickback and uncomputation to turn this circuit into an oracle

3. Use Grover's algorithm to solve this oracle

For lights out problem, I'm struggling with finding the classical solution to it using the known gates(like what they did for Sudoko using XOR gate).

If I start with an input  for a $$3$$x$$3$$ puzzle in which $$0$$ means off and one means lit, what would be the possible gates I can use to turn off all the lights eventually?

(I know the mathematical algebric solution to the lights out problem, should I probably use that as the reversible classical circuit?)

I appreciate it if anyone can guide me through this