Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
one match to rule them all solution in Clear category for One Switch Strings by juestr
from itertools import zip_longest
def switch_strings(line: str, result: str) -> bool:
match [(l, r) for l, r in zip_longest(line, result) if l != r]:
case []: return True
case [(l1, r1), (l2, r2)]: return (l1, l2) == (r2, r1)
case _: return False
Nov. 9, 2022