Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
translation dict and zip solution in Clear category for Surjection Strings by Phil15
def isometric_strings(str1: str, str2: str) -> bool:
if len(str1) != len(str2):
return False
translation = {}
for a, b in zip(str1, str2):
if a not in translation:
translation[a] = b
elif b != translation[a]:
return False
return True
Jan. 14, 2019
Comments: