It's unfortunate that the LeetCode type problems are an issue, because it's those types of companies that ignore gaps on resumes and other signals as long as you can pass the technical interview.
Have you built anything in the last 4 years, even if they weren't work related? Are you familiar with the latest trends and technologies? I think work on filling those gaps if the answer is no, if nothing else it'll dampen some of the imposter syndrome you'll be feeling.
In your situation I would apply to the Recurse Center: https://www.recurse.com/
I'd spend my time immersing myself in something I found interesting in tech, get depth, and utilize their connections to see if I can land a job in a related space.
Best of luck.