Description

About Catalan Number here is the description

The array of the number is: 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786….


def catalan_number(n):
    nm = dm = 1
    for k in range(2, n+1):
      nm, dm = ( nm*(n+k), dm*k )
    return nm/dm

Leetcode Test

  1. Binary Search Tree
    About how many structurally unique BST(binary search trees) that store value O(n)?

  2. Different Ways to Add Parentheses