标签:string com https href return for ring tco memset
class Solution {
public:
int m[300];
int m2[300];
bool isIsomorphic(string s, string t) {
if(s=="")
return true;
memset(m,-1,sizeof(m));
for(int i=0;i<s.length();i++)
{
if(m[s[i]]==-1)
{
if(m2[t[i]]==-1)
return false;
m[s[i]] = t[i];
m2[t[i]]=-1;
}
else
{
if(m[s[i]]!=t[i])
return false;
}
}
return true;
}
};
LeetCode 205. Isomorphic Strings
标签:string com https href return for ring tco memset
原文地址:https://www.cnblogs.com/dacc123/p/12306332.html