Create the function ```consecutive(arr)``` that takes an array of integers and return the minimum number of integers needed to make the contents of ```arr``` consecutive from the lowest number to the highest number.
For example:  If ```arr``` contains [4, 8, 6] then the output should be 2 because two numbers need to be added to the array (5 and 7) to make it a consecutive array of numbers from 4 to 8. Numbers in ```arr``` will be unique.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Starter code: def consecutive(arr):
	

Solutions:
def consecutive(arr):
	return max(arr) - min(arr) + 1 - len(arr) if arr else 0


def consecutive(arr):
	if len(arr) == 1 or len(arr) == 0:
		return 0
	(mn, mx) = (min(arr), max(arr))
	s = set(arr)
	return mx - mn - len(s) + 1


consecutive = lambda a: len(a) and -~max(a) - min(a) - len(a)


def consecutive(arr):
	try:
		return max(arr) - min(arr) - len(arr) + 1
	except:
		return 0


def consecutive(arr):
	if len(arr) < 2:
		return 0
	arr.sort()
	return arr[-1] - arr[0] - len(arr) + 1


def consecutive(arr):
	arr = sorted(arr)
	return arr[-1] - arr[0] - len(arr[1:]) if len(arr) > 0 else 0


def consecutive(arr):
	if not arr:
		return 0
	return max(max(arr) - min(arr) - len(arr) + 1, 0)