public int longestConsecutiveOld(int[] num) {
		int n = num.length;
		if (n == 0)
			return 0;
		Arrays.sort(num);		// problem this should be O(nlogn)
		int count = 1;
		int max = count;
		int pre = num[0];
		for (int i = 1; i < n; i++) {
			if (num[i] - pre > 1) {
				if (count > max) {
					max = count;
				}
				count = 1;
			} else if (num[i] - pre == 1) {
				count++;
			}
			pre = num[i];
		}
		if (count > max) {
			max = count;
		}
		return max;
	}