# 205. Isomorphic Strings ## Description Given two strings __s__ and __t__, determine if they are isomorphic. Two strings __s__ and __t__ are isomorphic if the characters in s can be replaced to get __t__. All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself. ## Solution Use find() string method to find charactors index, if s and t have different index structure means there are not isomorphic strings. ```python= def isIsomorphic(self, s: str, t: str) -> bool: return [s.find(i) for i in s]==[t.find(j) for j in t] ``` ### Example s = add t = bar ```python= print([s.find(i) for i in s)]) print([t.find(j) for j in t)]) ###Output 0 1 1 0 1 2 ``` ## Complxity Time complexity : O(N)