@@ -0,0 +1,625 @@
+// 128%0Aclass Solution %7B%0A    public int longestConsecutive(int%5B%5D nums) %7B%0A        // %E6%B3%A8%E6%84%8F%E5%85%B6%E5%A4%8D%E6%9D%82%E5%BA%A6%E8%AE%A1%E7%AE%97%0A        // %E8%AE%A9%E5%AD%98%E5%9C%A8%E7%9A%84%E6%95%B0%E5%A5%BD%E5%88%A4%E6%96%AD -%3E %E5%88%A4%E6%96%AD%E9%A2%84%E6%9C%9F%E7%9A%84%E6%95%B0%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%0A        Set%3CInteger%3E numSet = new HashSet%3C%3E();%0A        for (int n : nums) %7B%0A            numSet.add(n);%0A        %7D%0A        int maxLen = 0;%0A        int curLen;%0A        for (int n : numSet) %7B%0A            if (numSet.contains(n - 1)) %7B%0A                continue;%0A            %7D%0A            curLen = 1;%0A            while(numSet.contains(++n)) %7B%0A                curLen++;%0A            %7D%0A            if (curLen %3E maxLen) %7B%0A                maxLen = curLen;%0A            %7D%0A        %7D%0A        return maxLen;%0A    %7D%0A%7D%0A

Create LongestConsecutive.java