Pergunta de entrevista da empresa Palantir Technologies

Time and space complexity of sample code