Pergunta de entrevista da empresa BlackRock

2 questions about array manipulation and 1 dynamic programming question