Gosoft (Thailand) interview question

Solve the time series problem