Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Surjection Strings by archana.narvaneni
def isometric_strings(str1: str, str2: str) -> bool:
# your code here
c=[]
d=[]
if (len(str1) == len(str2)):
for i in range(len(str1)):
a=str1.count(str1[i])
c.append(a)
b=str2.count(str2[i])
d.append(b)
if(c == d):
return True
return False
if __name__ == '__main__':
print("Example:")
print(isometric_strings('add', 'egg'))
# These "asserts" are used for self-checking and not for an auto-testing
assert isometric_strings('add', 'egg') == True
assert isometric_strings('foo', 'bar') == False
assert isometric_strings('', '') == True
assert isometric_strings('all', 'all') == True
print("Coding complete? Click 'Check' to earn cool rewards!")
April 9, 2021
Comments: