Pregunta de entrevista de Amazon

OA questions, based on dynamic programming and heaps