Skip to content

Instantly share code, notes, and snippets.

@erlnby
Created May 1, 2020 13:42
Show Gist options
  • Save erlnby/37c9119fcaed4e7cb9e26a715e56a1c6 to your computer and use it in GitHub Desktop.
Save erlnby/37c9119fcaed4e7cb9e26a715e56a1c6 to your computer and use it in GitHub Desktop.
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