Question d’entretien chez Google

Find longest subsequence of consecutive elements in an array.