Starbucks interview question

Write a function in Python or R to identify days to buy/sell stock