Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
native_isometric_strings solution in Clear category for Surjection Strings by Jon_Red
def isometric_strings(str1:str,str2:str)->bool:
cipher={key:val for key,val in zip(str1,str2)}
return str2==''.join(cipher[value]for value in str1)
if __name__=='__main__':
# self-checks
assert isometric_strings('add','egg')==True
assert isometric_strings('foo','bar')==False
assert isometric_strings('','')==True
assert isometric_strings('all','all')==True
Aug. 12, 2020