Pergunta de entrevista da empresa ByteDance

leetcode coding, stocks questions,the third one