Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Surjection Strings by mikehult123
def isometric_strings(a: str, b: str) -> bool:
return len(set(a)) == len(set(zip(a, b)))
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!")
Feb. 7, 2023