aboutsummaryrefslogtreecommitdiff
path: root/challenge-268/eric-cheung/python/ch-1.py
blob: 093fd3f45ca619ed8c2f04f48c92542e348b61bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Example 1
## arrX = [3, 7, 5]
## arrY = [9, 5, 7]

## Example 2
## arrX = [1, 2, 1]
## arrY = [5, 4, 4]

## Example 3
arrX = [2]
arrY = [5]

arrX = sorted(arrX)
arrY = sorted(arrY)

nDiff = arrY[0] - arrX[0]

bIsSameDiff = True
for nIndx in range(1, len(arrX)):
    if arrY[nIndx] - arrX[nIndx] != nDiff:
        bIsSameDiff = False
        break

print (nDiff if bIsSameDiff else "")