From: Skullheadx <704277@pdsb.net> Date: Wed, 4 Jan 2023 20:43:59 +0000 (-0500) Subject: 2016 S1 X-Git-Url: http://git.skullheadx.com/nixos/projects.html?a=commitdiff_plain;h=29225eff4fa92d5006a8d65070a9670903c895a0;p=CCC.git 2016 S1 --- 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