https://leetcode.com/problems/isomorphic-strings/
Explanation1
2
3
4
5
6
7
8
9
10
11
12class Solution {
public boolean isIsomorphic(String s, String t) {
int[] m1=new int[128];
int[] m2=new int[128];
for(int i=0;i<s.length();i++){
if(m1[s.charAt(i)]!=m2[t.charAt(i)]) return false;
m1[s.charAt(i)]=i+1;
m2[t.charAt(i)]=i+1;
}
return true;
}
}