Pregunta de entrevista de Citadel Securities

Two sum problem with different time complexity, linearity of expectation problems.