Pergunta de entrevista da empresa Squarepoint Capital

Live leetcode medium level question. Know how to analyze runtime