LeetxodeDay 27
LeetxodeDay 27
PseudoCode:-
Time Complexity: O(k*nCk), here nCk means the binomial coefficient of picking k
elements out of n elements.
PseudoCode:-
Function generateParenthesis(n):
ans = [] // List to store valid parentheses combinations
function(n, ans, 0, 0, "") // Start the recursion with initial values
return ans
time complexity : (O(2^N)), where (N) is the number of pairs of parentheses ((2^N) represents
the total number of recursive calls).
PseudoCode:-
Function permute(nums):
ans = [] // List to store permutations
function(0, ans, nums)
return ans