I’ve been stuck on a LeetCode problem for a couple hours. I got 99% there, but my task was failing ~50% of the time. As I typed out a post for the FreeCodeCamp forum, I realized that it would be much easier for the people helping me if I documented by code and what it did.
I started from line one, slowly adding my explanations. As I got to line 66, I realized that I was returning an empty string when I shouldn’t have been. I changed it, and… voila. The code worked.
Just a tip