aboutsummaryrefslogtreecommitdiff
path: root/challenge-215/eric-cheung/python/ch-1.py
blob: 1398ab8a04d2d1ce5798d9d9370f4fff46ba9796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
## arrWordInput = ['abc', 'xyz', 'tsu']  ## Example 1
## arrWordInput = ['rat', 'cab', 'dad']  ## Example 2
arrWordInput = ['x', 'y', 'z']  ## Example 3

arrRemovedWord = []

for strWordLoop in arrWordInput:

    strSortWordLoop = ''.join(sorted(strWordLoop))
    if strWordLoop == strSortWordLoop:
        continue

    arrRemovedWord.append(strWordLoop)

print (len(arrRemovedWord))