Coupang interview question

coding question was related to dynamic programming