Longest consecutive element sequence in an unsorted array

Given an unsorted array, this algorithm finds the length of the longest consecutive elements sequence.

Problem

Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
Example input: [100, 4, 200, 1, 3, 2]
Example output: 4
Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.

Solution

This solution is in C#. Our A.I. can create solutions in multiple languages.
by kayakane
using System;
using System.Collections.Generic;
using System.Linq;

namespace InterviewPreperationGuide.Core.CrackingTheCodingInterview.c17q10 {
    public class Solution {
        public void Init () {
            Console.WriteLine ();
        }
    }
}

A.I. Evaluation of the Solution

The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The general approach is not clear.

Evaluated at: 2022-12-02 04:15:23