Agoda Interview Question

Solve the longest consecutive sequence problem