Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_sorted_array(arr):
- size = len(arr)
- for i in range(size):
- for j in range(i+1, size):
- if arr[i] > arr[j]:
- arr[i], arr[j] = arr[j], arr[i]
- return arr
- def solve(N, A, B):
- A = get_sorted_array(arr=A)
- B = get_sorted_array(arr=B)
- for i in range(len(A)):
- if A[i] != B[i]:
- return A[i]
- return -1
- N = input()
- A = map(int, raw_input().split())
- B = map(int, raw_input().split())
- out = solve(N, A, B)
- print(out_)
Advertisement
Add Comment
Please, Sign In to add comment