aboutsummaryrefslogtreecommitdiff
path: root/challenge-285/zapwai/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-285/zapwai/python/ch-1.py')
-rw-r--r--challenge-285/zapwai/python/ch-1.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/challenge-285/zapwai/python/ch-1.py b/challenge-285/zapwai/python/ch-1.py
new file mode 100644
index 0000000000..5722662b84
--- /dev/null
+++ b/challenge-285/zapwai/python/ch-1.py
@@ -0,0 +1,27 @@
+def proc(routes) :
+ print("Input: ")
+ for l in range(len(routes)):
+ print(" ",routes[l])
+ inlist = []
+ outlist = []
+ for j in routes:
+ inlist.append(j[0])
+ outlist.append(j[1])
+
+ ans = "a"
+ for needle in outlist :
+ found = 0
+ for hay in inlist:
+ if needle == hay :
+ found = 1
+ break
+
+ if found == 0 :
+ ans = needle
+
+ print("Output:", ans)
+
+routes = [["B","C"], ["D","B"], ["C","A"]]
+proc(routes)
+routes = [["A","Z"]]
+proc(routes)