TikTok interview question

Find the largest consecutive sum in an array.

Interview Answer

Anonymous

Jan 13, 2023

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