For this Question: Given an array of N strings, find the longest common prefix among all strings present in the array.The fist line of each test contains a single integer N. Next line has space-separated N strings.

Constraints:-
1 <= N <= 10^3
1 <= |S| <= 10^3
Print the longest common prefix as a string in the given array. If no such prefix exists print "-1"(without quotes).Sample Input:
4
geeksforgeeks geeks geek geezer

Sample Output:
gee

Sampel Input:-
3
a b c

Sample Output:-
-1, I have written this Solution Code: def longestPrefix( strings ):
    size = len(strings)
    if (size == 0):
        return -1
    
    if (size == 1):
        return strings[0]
    
    strings.sort()
    end = min(len(strings[0]), len(strings[size - 1]))

    i = 0
    while (i < end and
           strings[0][i] == strings[size - 1][i]):
        i += 1
 
    pre = strings[0][0: i]
    if len(pre) > 1:
        return pre
    else:
        return -1

N=int(input())
strings=input().split()

print( longestPrefix(strings) ), In this Programming Language: Python, Now tell me if this Code is compilable or not?