776. Split BST

Description

Here

Intuition

很简单的recursion

  1. if root.val > V
    1. res[1] must be root
    2. root.left will be result of 1st(0 based) element of splitBST(root.left, V)
    3. res[0] must be result of 0th(0 based) element of splitBST(root.left, V)

Pitfall

Solution

results matching ""

    No results matching ""