Pergunta de entrevista da empresa Starbucks

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