update .gitignore, remove .vscode and .idea folders, move berkely to ysu-acm

This commit is contained in:
Xevion
2020-03-01 21:01:11 -06:00
parent 71d00e8b23
commit d2d461a5f9
55 changed files with 2 additions and 2969 deletions

View File

@@ -0,0 +1,14 @@
import re, string, os, sys
pattern = r'([\s\S]*)(\(.*\))([\s\S]*)'
def main():
path = os.path.join(sys.path[0], 'input')
mapping = str.maketrans(string.ascii_uppercase, string.ascii_uppercase[::-1])
print(string.ascii_uppercase)
print(string.ascii_uppercase[::-1])
data = open(path, 'r').read()
matches = re.findall(pattern, data)[0]
result = ''
for match in matches:
result += match if match.startswith('(') else match.translate(mapping)
print(result)