From 742776ba40e5a4e98ee1afd2345f87753ae8fb8a Mon Sep 17 00:00:00 2001 From: MyatCharm Date: Wed, 5 Feb 2025 01:56:42 +0700 Subject: [PATCH 1/3] Team_ROOM_1_Solutions --- challenges/challenge1.py | 11 +++++++++++ challenges/challenge2.py | 31 +++++++++++++++++++++++++++++++ challenges/challenge3.py | 5 +++++ 3 files changed, 47 insertions(+) diff --git a/challenges/challenge1.py b/challenges/challenge1.py index 182c032..1b995b5 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -26,3 +26,14 @@ Interpret what the final expression means in the context of allowing or blocking a login attempt. """ +not(A and(B or not B)) +not (A and True) +not A + +The login credentials are not correct. The login attempt is blocked. + +#Oleksandr Maksymikhin +#Momtaz Yaqubi +#Rafaa Ali +#Derek Karungani +#Myint Myat diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 504b52b..27282b5 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -29,3 +29,34 @@ # -*- coding: utf-8 -*- """ +at_least_one = finance_access.union(tech_access).union(all_access) +both_fincance_tech = finance_access.intersection(tech_access) +exclusive = (finance_access.intersection(tech_access)) + +#lack access +lack_access = [] +for i in All_employees: + has_access = False + for j in at_least_one: + if i == j : + has_access = True + if has_access == False: + lack_access.append(i) + +print (lack_access) + +overlap = both_fincance_tech + + """ + _Recommendation + We recommend do add one more group that include + employeeID who have access to both finance and tech + data to manage this group separately_ + """ + + +#Oleksandr Maksymikhin +#Momtaz Yaqubi +#Rafaa Ali +#Derek Karungani +#Myint Myat diff --git a/challenges/challenge3.py b/challenges/challenge3.py index d20302e..41c5f3d 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -20,3 +20,8 @@ Are there risks? Indicate employees who might be exposed to unnecessary data. Your output should visually highlight these relationships without explicitly listing them in a simple table or list. Think beyond just printing data—use a format that helps detect patterns at a glance. """ +from matplotlib_venn import venn2 +import matplotlib.pyplot as plt + +venn2([finance_access,tech_access], set_labels =('Finace','Tech')) +plt.show() From cc2b3d3dd78d21a4a5c45003c088239e08708c45 Mon Sep 17 00:00:00 2001 From: MyatCharm Date: Wed, 5 Feb 2025 02:59:16 +0700 Subject: [PATCH 2/3] challenge 4 solutions --- challenges/challenge4.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/challenges/challenge4.py b/challenges/challenge4.py index e3638b3..9b34033 100644 --- a/challenges/challenge4.py +++ b/challenges/challenge4.py @@ -32,3 +32,27 @@ Optionally convert the result back to binary with bin(), but focus on the XOR operation itself. """ +#Oleksandr Maksymikhin +#Myint Myat +#Rafaa Ali +#Derek Karungani + +data_for_transmission_string = '1010101' +data_for_transmission = int(data_for_transmission_string,2) +security_key = int("1100110",2) +checksum = data_for_transmission ^ security_key +checksum_for_transmission = bin(checksum) + + + +def receiver_verify_data(data_for_transmission_string,checksum_for_transmission): + data_after_transmission = int(data_for_transmission_string,2) + receiver_checksum = data_after_transmission ^ security_key + + if receiver_checksum == checksum_for_transmission: + return "Transmission is successful" + else: + return "Transmission failed" + +receiver_verify_data(data_for_transmission_string,checksum_for_transmission) + \ No newline at end of file From e0b9aab1bb897a191486a55b4a89c175107419a0 Mon Sep 17 00:00:00 2001 From: MyatCharm Date: Wed, 5 Feb 2025 03:00:15 +0700 Subject: [PATCH 3/3] challenge 4 --- .vscode/settings.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5f1bbc6..984f7d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -116,5 +116,8 @@ "markdown.extension.toc.updateOnSave": false, "python.testing.unittestArgs": ["-v", "-s", ".", "-p", "test_*.py"], "python.testing.pytestEnabled": false, - "python.testing.unittestEnabled": true + "python.testing.unittestEnabled": true, + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] }