class Solution { public boolean isIsomorphic(String s, String t) { int[] s1 = new int[256]; int[] t1 = new int[256]; for(int i = 0; i < s.length();i++){ char sc = s.charAt(i); char tc = t.charAt(i); if(s1[sc] != t1[tc]) return false; s1[sc] = i + 1; t1[tc] = i + 1; } return true; } }
|