# Task
 You are given an array of integers `arr` that representing coordinates of obstacles situated on a straight line.

 Assume that you are jumping from the point with coordinate 0 to the right. You are allowed only to make jumps of the same length represented by some integer.

 Find the minimal length of the jump enough to avoid all the obstacles.

# Example

 For `arr = [5, 3, 6, 7, 9]`, the output should be `4`.

 Check out the image below for better understanding:

 


# Input/Output


 - `[input]` integer array `arr`

    Non-empty array of positive integers.

    Constraints: `1 ≤ inputArray[i] ≤ 100.`


 - `[output]` an integer

    The desired length.

Difficulty: introductory

Starter code:

def avoid_obstacles(arr):
	

Solutions:
def avoid_obstacles(arr):
  n=2
  while 1: 
    if all([x%n for x in arr]): return n
    n+=1

def avoid_obstacles(a):
    for j in range(2, max(a) + 2):        
        if all(e % j != 0 for e in a): return j

def avoid_obstacles(arr):
    s = set(arr)
    m = max(arr)
    for i in range(1, m+2):
        if i in s:
            continue
        if not any(x in s for x in range(i, m+1, i)):
            return i

def avoid_obstacles(arr):
    obstacles = set(arr)
    limit = max(arr) + 2
    for step in range(1, limit):
        if not (set(range(0, limit, step)) & obstacles):
            return step


def avoid_obstacles(arr, n=1):
    arr = set(arr)
    while set(range(0, 100+1, n)) & arr:
        n += 1
    return n

avoid_obstacles=lambda a:min(n for n in range(1,max(a)+2)if all(m%n for m in a))

def avoid_obstacles(arr):
    if min(arr) == 1 and max(arr) == 100: return 101
    landed = True
    for max_jump in range(2, 100):
        n = max_jump
        landed = True
        while n <= 100:
            for i in range(len(arr)):
                if n == arr[i]:
                    landed = False
                    break
            n += max_jump
        if landed:
            return max_jump

def avoid_obstacles(arr):
    jump = 2
    
    while True:
        start_again = False
        
        for num in arr:
            if num % jump == 0:
                jump = jump + 1
                start_again = True
                break
        
        if not start_again:
            return jump


def avoid_obstacles(arr):
    holes = set(range(2, max(arr))).difference(arr)
    for step in holes:
        if all([x % step != 0 for x in arr]):
            return step
    return max(arr) + 1

def avoid_obstacles(arr):
    x = 2
    for i in range(max(arr)):
        leaps = [x*i for i in range(1,max(arr))]
        
        for i in leaps:    
            if i in arr:
                leaps = []
                x += 1
                break        
    return x