Agoda interview question

Solve the longest consecutive sequence problem