Pregunta de entrevista de Benepik

In initial rounds I was asked two questions, one based on dynamic programming and other on SQL.