← 返回 meta 的题目列表Longest Increasing Sequence in BST
类型:online_judge
Given a Binary Search Tree, find its longest increasing subsequence. The subsequence must maintain the order of the original nodes. The tree node is defined as:
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
Return the length of the longest increasing subsequence.
Example
Input
1 1 2 3