Pregunta de entrevista de Starbucks

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