aboutsummaryrefslogtreecommitdiff
path: root/challenge-215/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-215/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-215/eric-cheung/python/ch-1.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-215/eric-cheung/python/ch-1.py b/challenge-215/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..1398ab8a04
--- /dev/null
+++ b/challenge-215/eric-cheung/python/ch-1.py
@@ -0,0 +1,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))