Pregunta de entrevista de TikTok

Find the largest consecutive sum in an array.

Respuesta de la entrevista

Anónimo

13 de ene de 2023

I used a linear time algorithm that iterated through the array while keeping track of a current sum and a globalMax.