DigiFinex interview question

Markov chain, matrix, dp, dataframe copy.