Solución
solution.tsTypeScript
import re
def rot13(text: str) -> str:
ans = ""
for letter in text:
if not re.fullmatch(r"[a-zA-Z]", letter):
ans += letter
continue
ascii_value = ord(letter)
new_value = ascii_value + 13
is_upper = ascii_value >= 65 and ascii_value <= 90
if (is_upper and new_value > 90) or (not is_upper and new_value > 122):
new_value -= 26
ans += chr(new_value)
return ans0respuestas