For this Question: Given a sequence of n numbers such that the difference between the consecutive terms is constant, find the missing term in logarithmic time. Assume that the first and last elements are always part of the input sequence and the missing number lies between index 1 to n-1.
Solve the problem using divide and conquer approach.first line contain a single integer N.
second line contain N space separated integer A[i].print missing number in given array.

Constraint :
1<=N<=10^5
1<=A[i]<=10^9Sample Input 1: 
5
5 7 9 11 15

Sample Output 1: 
13
 
Sample Input 2: 
5
1 4 7 13 16

Sample Output 2: 
10, I have written this Solution Code: def find_missing(arr, n):
    first = arr[0]
    last = arr[-1]
    
    if (first + last) % 2:
        s = (n + 1) / 2
        s *= (first + last)
    else:
        s = (first + last) / 2
        s *= (n + 1)

    print(int(s - sum(arr)))
    
N=int(input())
arr = list(map(int,input().split()))
n = len(arr)
missing = find_missing(arr, n)
missing, In this Programming Language: Python, Now tell me if this Code is compilable or not?