时间复杂度 O(n ^ 2)
空间复杂度 O(1)
遍历判断每个字符在 s 和 t 中各自出现的首位置
同构词相应字母出现的首位置必然是相同的。
Last updated 3 years ago
Was this helpful?