Robert Bosch interview question

Hackerrank questions about DP and data structures