Pergunta de entrevista da empresa Atlassian

Was a simple take not take DP problem