You know the famous quote:
“Never commit to memory what can be easily looked up in books” - Albert Einstein.
So unless you’ve already memorized that sorting algorithm by heart, why in the world would you want to spend 2 hours trying to figure it out yourself? Worst, why would you want to re-implement something half-assed from scratch when you can just find someone who’s done it before?
Excluding for fun and educational purposes, I can understand some reasons wanting to build out something proprietary long term, but chances are, unless you’re an absolute genius, the collaborative efforts of an open source project will beat whatever you can do in 8 hrs.
If you need to implement something in code and it’s not cutting edge technology, Google it first. If someone else hasn't already done it yet, you’re either Googling it wrong or way off in what you’re trying to accomplish. If you’ve given it your best effort, find someone to ask for help.
The best programmers I know understand how to architect and build large projects piece by piece. They can focus on the macro because don’t get hung up in the pieces. They know how to use Google to find solutions fast. DRY.