Funny, but I've recently started a blog to keep my math and physics muscles working and this exact problem is the first post I've written - it is useful in high order perturbation theory in quantum mechanics that I'm planning to describe down the line. Counting these paths is cool problem but generating all of them was more challenging.
Anyway, here is the post https://kpatucha.github.io/posts/Dyck-paths-Raneys-lemma/