Pregunta de entrevista de Google

time complexities, dynamic programming coding question