Pregunta de entrevista de Atlassian

Asked on DP and time complexity from basic to optimal