aboutsummaryrefslogtreecommitdiff
path: root/challenge-193/eric-cheung/python/ch-2.py
blob: a28f7f0aacdff25beddd3d2a5fe305b2fa009b56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def GetDiffStr(strInput):
    return ",".join([str(ord(strInput[nIndx]) - ord(strInput[nIndx - 1])) for nIndx in range(1, len(strInput))])

## arrInputStr = ["adc", "wzy", "abc"]  ## Example 1
arrInputStr = ["aaa", "bob", "ccc", "ddd"]  ## Example 2

arrStrAppend = []
strOdd = ""

for strLoop in arrInputStr:
    arrStrAppend.append(GetDiffStr(strLoop))

for nIndxLoop, strLoop in enumerate(arrStrAppend):
    if arrStrAppend.count(strLoop) == 1:
        strOdd = arrInputStr[nIndxLoop]
        break

print (strOdd)