Tibra interview question

problem solving dynamic programming time series.