mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 08:50:15 +08:00
205.同构字符串 添加Java版本(注释修改)
This commit is contained in:
@ -77,7 +77,7 @@ class Solution {
|
||||
map1.put(s.charAt(i), t.charAt(j)); // map1保存 s[i] 到 t[j]的映射
|
||||
}
|
||||
if (!map2.containsKey(t.charAt(j))) {
|
||||
map2.put(t.charAt(j), s.charAt(i)); // map1保存 t[j] 到 s[i]的映射
|
||||
map2.put(t.charAt(j), s.charAt(i)); // map2保存 t[j] 到 s[i]的映射
|
||||
}
|
||||
// 无法映射,返回 false
|
||||
if (map1.get(s.charAt(i)) != t.charAt(j) || map2.get(t.charAt(j)) != s.charAt(i)) {
|
||||
|
Reference in New Issue
Block a user