solve the longest consecutive sequence problem.