Rating:

tl;dr brute force, recursion

Original writeup (https://dunsp4rce.github.io/rgbCTF-2020/misc/2020/07/16/insert-creative-algo-chall-name.html).