Fractal interview question

Machine learning coding question ; Dynamic programming