Tiger Analytics interview question

Python code to extract the best entry & exit time in stock data to get the maximum profit