aboutsummaryrefslogtreecommitdiff
path: root/challenge-226/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
author冯昶 <fengchang@novel-supertv.com>2023-07-24 17:16:48 +0800
committer冯昶 <fengchang@novel-supertv.com>2023-07-24 17:16:48 +0800
commit4fda4a4a398e64921020704733556a2ec6dae78a (patch)
treef2b70bccff1e2d183104042921d0726f7a8e5f40 /challenge-226/eric-cheung/python/ch-1.py
parenta296c2a161ce1fffe7c7c1108346c81f027af419 (diff)
parente4bdf5dcb6e741f1fb8e1b145fd2111f05ed6445 (diff)
downloadperlweeklychallenge-club-4fda4a4a398e64921020704733556a2ec6dae78a.tar.gz
perlweeklychallenge-club-4fda4a4a398e64921020704733556a2ec6dae78a.tar.bz2
perlweeklychallenge-club-4fda4a4a398e64921020704733556a2ec6dae78a.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'challenge-226/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-226/eric-cheung/python/ch-1.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-226/eric-cheung/python/ch-1.py b/challenge-226/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..bd083aa7f7
--- /dev/null
+++ b/challenge-226/eric-cheung/python/ch-1.py
@@ -0,0 +1,12 @@
+
+## Example 1
+## strInput = "lacelengh"
+## arrIndices = [3, 2, 0, 5, 4, 8, 6, 7, 1]
+
+## Example 2
+strInput = "rulepark"
+arrIndices = [4, 7, 3, 1, 0, 5, 2, 6]
+
+strOutput = "".join([strInput[arrIndices.index(nLoop)] for nLoop in range(len(strInput))])
+
+print (strOutput)