def longest_consecutive_subsequence(array):
	"""
	Given an array of integers, find the length of the 
	longest sub-sequence such that elements in the subsequence 
	are consecutive integers, the consecutive numbers can be in any order.
	"""

	n = len(array)
	result = 0

	# Insert all array elements into a hash
	d = {}
	for i in array:
		d[i] = 1

	for i in range(n):
		current = array[i]
		while current in d.keys():
			current = current + 1
		result = max(result, current - array[i])

	return result