You will learn so much more by doing it that way, instead of looking at an already made solution or even worse, caring only for the result.
The greater the obstacle, the more glory in overcoming it. – Molière
Here are some overall details about each solution. I used GitHub actions to generate it automatically.
Those metrics should be taken with a grain of salt since I did not use rigorous benchmark technics (like running several times the program and taking the mean out of all the results)