From 29225eff4fa92d5006a8d65070a9670903c895a0 Mon Sep 17 00:00:00 2001 From: Skullheadx <704277@pdsb.net> Date: Wed, 4 Jan 2023 15:43:59 -0500 Subject: [PATCH] 2016 S1 --- Main/Python/2016/S1.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Main/Python/2016/S1.py diff --git a/Main/Python/2016/S1.py b/Main/Python/2016/S1.py new file mode 100644 index 0000000..0484fb7 --- /dev/null +++ b/Main/Python/2016/S1.py @@ -0,0 +1,25 @@ +from string import ascii_lowercase + +line1 = input() +line2 = input() + +letters1 = {i:0 for i in ascii_lowercase} +letters2 = {i:0 for i in ascii_lowercase + "*"} + +for a,b in zip(line1,line2): + letters1[a] += 1 + letters2[b] += 1 + + +missing = 0 +for a,b in zip(letters1.values(), letters2.values()): + if a < b: + print("N") + quit() + elif a > b: + missing += a-b + +if missing == letters2["*"]: + print("A") +else: + print("N") \ No newline at end of file -- 2.54.0