Created
May 1, 2020 13:42
-
-
Save erlnby/37c9119fcaed4e7cb9e26a715e56a1c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import array as ar | |
old = ar.array('u', 'itmathrepetitor') | |
new = ar.array('u', 'silence') | |
line = input() | |
a = ar.array('u', line) | |
for i in range(len(line) - len(old) + 1): | |
if a[i:i + len(old)] == old: | |
a[i:i + len(old)] = new | |
print(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment