Two Sigma interview question

Write a DP program to buy low / sell high