Hi, this is Shunchi!

  • Home

  • Tags0

  • Archives267

  • Categories0

  • Curricula

  • DSA

  • LeetCode_Notes

  • Interviews

  • General

  • Resume

205. Isomorphic Strings

Posted on 2020-05-26 | Edited on 2021-01-22

https://leetcode.com/problems/isomorphic-strings/

Explanation

1
2
3
4
5
6
7
8
9
10
11
12
class 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;
}
}

<1…187188189…267>
ShunchiZhou

ShunchiZhou

267 posts
RSS
GitHub E-Mail Gitbook Linkedin
© 2024 ShunchiZhou
Powered by Hexo v5.4.0
|
0%