Word or phrase that means to solve a problem mainly via trial and error

The phrase brute force covers some of that, though it is not random, but instead slightly more methodical. It is like trial and error, but generally enumerating all possible solutions and then trying them one by one. For example, you want to solve an equation with two positive integer variables: you start with both set to zero, and then try out if the equation works. If not, you increment one, and repeat. Until you have found a combination that works. Or, in the words of the question: "by exhausting every move possible until everything clicks into place"

While it has a 'method', it is somewhat self-deprecating, as I solved the equation through brute force implies that you didn't do it in the mathematically best way. If has the connotations of dumb repetitive trial and error.

Most dictionaries only list "brute force" as a noun relating to strength (e.g. Merriam-Webster, dictionary.com), but Wiktionary has entries relating to the sense we want:

Noun

  1. (computer science) A method of computation wherein the computer is let to try all permutations of a problem until one is found that provides a solution, in contrast to the implementation of a more intelligent algorithm.

Verb

  1. (transitive) To solve (a computational problem) by brute force methods.

Therefore you could say: "I brute-forced my way through this puzzle".

(NB Wiktionary is not generally accepted as a respected dictionary, but it is often more up to date with neologisms than more respected dictionaries. Words/phrases that don't appear in respected dictionaries are less likely to be widely understood.)

(I do acknowledge the replies to my original comment, which is why I did not first post this as an answer. But re-reading the question I believe it could match the OP's intended meaning.)


If you want complete absence of methodology, one could find the solution by throwing everything against the wall and seeing what sticks (although brute force is more applicable to your puzzle example -- where there is a kind of methodology at work: a dumb brute force method as opposed to a smarter method that brings logic to bear.)


stumble through something TFD

to get through a sequence of something awkwardly and falteringly.

I stumbled through the completion of the puzzle.


Empirically

As in ‘ I solved the problem empirically’ - it means ‘by trial and error’ or experimentation.

Definition, The Free Dictionary:

Relying on or derived from observation or experiment: empirical results that supported the hypothesis.

https://www.thefreedictionary.com/empirically

A doctor said this to me once - that we could ‘treat the problem empirically’. I didn’t know what he meant at first, but he meant - ‘take the medicine anyway, even though we’re not completely sure what the problem is, then we’ll see what happens, and decide next steps according to the results.’