I was actually going to recommend exactly that - I find that, when I have a problem that I’m having trouble solving, just brute-forcing the damned thing helps me focus on the hard parts of the problem, and then I end up rewriting things in a “better” way that I’m actually not ashamed to put my name to.
Correct first, then simple and fast later. With more experience you'll be able to devise simpler, correct first solutions that you can then speed up later.