]> Skullheadx's Git Forge - CCC.git/commitdiff
2016 S1
authorSkullheadx <704277@pdsb.net>
Wed, 4 Jan 2023 20:43:59 +0000 (15:43 -0500)
committerSkullheadx <704277@pdsb.net>
Wed, 4 Jan 2023 20:43:59 +0000 (15:43 -0500)
Main/Python/2016/S1.py [new file with mode: 0644]

diff --git a/Main/Python/2016/S1.py b/Main/Python/2016/S1.py
new file mode 100644 (file)
index 0000000..0484fb7
--- /dev/null
@@ -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