Pergunta de entrevista da empresa Deutsche Bank

A question about stack and queue and a leetcode difficult question about checking rate