Would you care to expand on how Anki helped you with Leetcode problems?
Did you just think of a solution in your head and then compared it with the back of the card?
Worth noting I also became much more adept at things like list comprehensions and using Counters and DefaultDicts in Python this way. When you type out a solution over and over like that, your brain naturally wants to chunk things down as much as possible.
I'm tempted to try it for my self. Did you only include problems that you solved previously?
Eventually I got good enough that I started naturally thinking up solutions to entirely new problems without having to check the answer first, which is what one would expect if they were building new crystallized intelligence by practicing earlier problems.