Domanda di colloquio di TikTok

Find the largest consecutive sum in an array.

Risposta di colloquio

Anonimo

13 gen 2023

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