summaryrefslogtreecommitdiff
path: root/progs/a946.py
blob: cbfdb8230ef88c6ce918c03d757f753c44e7524f (plain)
1
2
3
4
5
6
7
def catalan_number(num):
    if num <=1:
         return 1   
    res_num = 0
    for i in range(num):
        res_num += catalan_number(i) * catalan_number(num-i-1)
    return res_num