MCPcopy Create free account
hub / github.com/algorithm004-01/algorithm004-01 / isIsomorphic

Method isIsomorphic

Week 08/id_306/Isomorphic.java:24–34  ·  view source on GitHub ↗

简单解法 字符串中,同一个位置的字符在本串中第一次出现的位置相同。我简单解释一下,本题判定为false有这些个情况,我们假设拿s串和t串作对比 1.s串中相同的字符,对应的t串中的字符并不相等 2.s串中不同的字符,对应的t串中的字符却是相等的 所以判断的关键点就是相同的字符要对应相同的字符,那么相同字符处于后位置的字符的第一次出现的位置就应该相同。 所以我们在判断时,只需要判断两个字符串同位置的字符是否相同即可。 @param s @param t @return

(String s, String t)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected