Pergunta de entrevista da empresa Amazon

Stock buy sell 3 Dynamic Programing Problem and Valid parenthesis(modified one)