Two Sigma Interview Question

Write a DP program to buy low / sell high