Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
surjection_strings solution in Clear category for Surjection Strings by dannedved
def isometric_strings(str1: str, str2: str) -> bool:
# Zipping str1 and str2 gives us pairs of characters on the same positions in both strings.
# The number of unique pairs must be equal to the number of unique characters in either of the strings.
return len(set(zip(str1, str2))) == len(set(str1))
May 16, 2020