How to not miss edge cases - Beginner's problem

I have just started solving leetcode questions and I am currently experiencing 2 problems - I come up with a general solution (Easy questions) and then run to realize all the edge cases for which my code fails. Then i tweak my code to handle edge cases and the code passes. But after so many tweaks i kind of forget what I did at first to come up with this solution and then i have to go over my own solution - is it normal in the beginning?
Apologies for a noob question

Comments (2)