LeetCode mostly has algorithmic tasks. Of course it's helpful during learning syntax, working with memory, optimizing performance. However, the standard library and other useful libraries and frameworks take much more time to learn them.
The best way to learn a new language is to follow a proper structured resource which would cover syntax, semantic, tooling & ecosystem and best practices.