uva 131 and leet code unique binary search tree problem