- Given an array representing a binary tree that is constructed with pre-order traversal, determine if the array can represent a BST.
- Similar to best time to sell stocks, but you can keep multiple stocks and sell them all at once, find the maximum profit given an array of stock prices. For example, given array [1,2,3,4,5], you can buy the stocks at price point 1, 2, 3, 4 and sell all the stocks at price point 5. Hence, your profit would be 10.
Anyone knows how to approach these two questions?