aboutsummaryrefslogtreecommitdiff
path: root/challenge-226/deadmarshal/python/ch1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-226/deadmarshal/python/ch1.py')
-rw-r--r--challenge-226/deadmarshal/python/ch1.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-226/deadmarshal/python/ch1.py b/challenge-226/deadmarshal/python/ch1.py
new file mode 100644
index 0000000000..7bc4e9c68c
--- /dev/null
+++ b/challenge-226/deadmarshal/python/ch1.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+def shuffle_string(s,arr):
+ ret = [None] * len(arr)
+ for i in range(0,len(arr)): ret[arr[i]] = s[i]
+ return ''.join(ret)
+
+print(shuffle_string('lacelengh',[3,2,0,5,4,8,6,7,1]))
+print(shuffle_string('rulepark',[4,7,3,1,0,5,2,6]))
+