Google Interview Question

Related to Dynamic programming using map/dictionary(in js)