Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No tricks solution in Clear category for Surjection Strings by amandel
def isometric_strings(a: str, b: str) -> bool:
d=dict()
for x,y in zip(a,b):
if x in d and d[x] != y:
return False
d[x] = y
return True
print("Example:")
print(isometric_strings("add", "egg"))
assert isometric_strings("add", "egg") == True
assert isometric_strings("foo", "bar") == False
assert isometric_strings("bar", "foo") == True
assert isometric_strings("", "") == True
assert isometric_strings("all", "all") == True
assert isometric_strings("gogopy", "doodle") == False
assert isometric_strings("abba", "cccc") == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
Oct. 10, 2022
Comments: