void dfs(TreeNode x, List<Integer> list) {
        if (x == null) return;
        list.add(x.val);
        dfs(x.left, list);
        dfs(x.right, list);
    }
Solution 1:
solution one building valid bst from preorder traversal of input tree and check if they are the same
src/problems/medium/ValidateBinarySearchTree.java