VinFast interview question

DP for path total calculation