Validate a BST
Problem With a binary tree as input, determine if the tree is a BST or not Input node: Has 3 properties .val: Integer value of the »
Problem With a binary tree as input, determine if the tree is a BST or not Input node: Has 3 properties .val: Integer value of the »
Problem Return the values of a binary tree using in-order traversal, iteratively. Input node: Has 3 properties .val: Integer value of the node .left: A pointer »
Problem Given an array of integers representing stock prices, with each index representing a different day, find the maximum profit by selling at most two stocks. »
var jsav = new JSAV("set"); jsav.label("Before rotation").css({"color": "gray"}); var m = jsav.ds.matrix([[0, 1, 2], [3, 4, 5], [6, 7, 8] »
Problem Given a 2D array of black-and-white points and an entry point, flip the color of all points connected to the entry point (including the entry »