Solved Unique binary search tree II problem