<s> class Solution : <EOL> def isIsomorphic ( self , s , t ) : <EOL> if len ( s ) != len ( t ) : <EOL> return False <EOL> return self . halfIsom ( s , t ) and self . halfIsom ( t , s ) <EOL> def halfIsom ( self , s , t ) : <EOL> lookup = { } <EOL> for i in xrange ( len ( s ) ) : <EOL> if s [ i ] not in lookup : <EOL> lookup [ s [ i ] ] = t [ i ] <EOL> elif lookup [ s [ i ] ] != t [ i ] : <EOL> return False <EOL> return True </s>
