My code is failing this testcase. Can someone please help me understand what is incorrect with my code?
Input: "badc" "baba" Output: true Expected: false
class Solution(object):
def isIsomorphic(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
dict = {}
if len(s)==0 or len(t)==0:
return False
for i in range(len(s)):
if s[i] in dict:
if dict[s[i]] != t[i]:
return False
else:
dict[s[i]] = t[i]
return True