Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Surjection Strings by Pavellver
def isometric_strings(a: str, b: str) -> bool:
d = dict(zip(a, b))
for ind, letter in enumerate(a):
if d[letter] != b[ind]:
return False
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!")
April 3, 2023
Comments: