Google Interview Question

A DSA question based on Dynamic Programming.