Google Interview Question

time complexities, dynamic programming coding question