How to Think Recursively - Part 2

Please read How to Think Recursively before reading this post. This post re-applies the steps mentioned in the previous post on a more challenging question. Question Return all possible ways we can generate a well-formed parenthesis? Examples: if n = 1 then we can only form () if n = 2 then we can form (()) and ()() if n = 3 then we can form ((())), (())(), ()(()), (()()), (), (), () Let’s try applying our 4 steps:...

November 15, 2022 Β· 5 min