To solve a problem, we first have to design an algorithm that will generate a solution.
Any computation is possible; you just might still be waiting for the solution when the Universe dies.
Each magnet can be oriented with the north pole pointing up or down, but not in between.
In the case of two magnets, the answer is simple.
You have four possible configurations: both magnets point down, both point up, or both are oppositely oriented.
If all the magnets are coupled—meaning that they're all influenced by the magnetic field generated by all of the other magnets—and the coupling between individual magnets can be tuned, then the lowest energy configuration can be the solution to a computational problem.