Pergunta de entrevista da empresa Cisco

Leetcode based dp and array easy question