public int longestConsecutive(int[] num) {
		if (num.length <= 1)
			return num.length;
		Arrays.sort(num);
		// int longest = 1;
		int[] longest = new int[num.length];
		longest[0] = 1;
		int max = 1;
		for (int i = 1; i < num.length; i++) {
			if (num[i] > num[i - 1])
				longest[i] = longest[i - 1] + 1;
			else if (num[i] == num[i - 1]) {
				longest[i] = longest[i - 1];
			} else {
				longest[i] = 1;
			}
			if (max < longest[i])
				max = longest[i];
		}
		return max;
	}