aboutsummaryrefslogtreecommitdiff
path: root/challenge-046/orestis-zekai/python
diff options
context:
space:
mode:
authorMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-02-08 06:31:11 +0100
committerMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-02-08 06:31:11 +0100
commit6e3ffc32e2c3e4ebff49d101e21ff79b2ab29695 (patch)
tree0bb55dbdc9710cf3381cb4530bb898479579353a /challenge-046/orestis-zekai/python
parentc35740ed11245d31ffe39492774600cb1abf065d (diff)
parent90ba2a3e9be09c64ed20d58b0145668dafb22d11 (diff)
downloadperlweeklychallenge-club-6e3ffc32e2c3e4ebff49d101e21ff79b2ab29695.tar.gz
perlweeklychallenge-club-6e3ffc32e2c3e4ebff49d101e21ff79b2ab29695.tar.bz2
perlweeklychallenge-club-6e3ffc32e2c3e4ebff49d101e21ff79b2ab29695.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'challenge-046/orestis-zekai/python')
-rw-r--r--challenge-046/orestis-zekai/python/ch-1.py14
-rw-r--r--challenge-046/orestis-zekai/python/ch-2.py19
2 files changed, 33 insertions, 0 deletions
diff --git a/challenge-046/orestis-zekai/python/ch-1.py b/challenge-046/orestis-zekai/python/ch-1.py
new file mode 100644
index 0000000000..27c7ed5e99
--- /dev/null
+++ b/challenge-046/orestis-zekai/python/ch-1.py
@@ -0,0 +1,14 @@
+import collections
+
+message = [['H', 'x', 'l', '4', '!'], ['c','e','-','l','o'], ['z','e','6','l','g'], ['H','W','l','v','R'], ['q','9','m','#','o']]
+
+final_word = ''
+for j in range(0, len(message)):
+ my_list = []
+ for i in message:
+ my_list.append(i[j])
+
+ counter = collections.Counter(my_list)
+ final_word += str(counter.most_common()[0][0])
+
+print(final_word) \ No newline at end of file
diff --git a/challenge-046/orestis-zekai/python/ch-2.py b/challenge-046/orestis-zekai/python/ch-2.py
new file mode 100644
index 0000000000..b86235f21a
--- /dev/null
+++ b/challenge-046/orestis-zekai/python/ch-2.py
@@ -0,0 +1,19 @@
+rooms = 500
+employees = 500
+
+# The first employee opens all the doors
+doors = [1 for i in range(0,rooms)]
+
+for i in range(1, employees):
+ j = i
+ step = i + 1
+ while (j < 500):
+ if (doors[j] == 0):
+ doors[j] = 1
+ else:
+ doors[j] = 0
+
+ j += step
+
+print(doors)
+print(sum(doors)) \ No newline at end of file