Tesla interview question

Python Coding assignment, time series handling and I failed that