Pergunta de entrevista da empresa Zoox

Array processing algorithm question, with followup to make it more challenging.