mapping_s_t
and mapping_t_s
.s
and t
using a loop.
c1
be the current character from s
and c2
be the corresponding character from t
.(c1, c2)
:
c1
is not in mapping_s_t
and c2
is not in mapping_t_s
, add c1 -> c2
to mapping_s_t
and c2 -> c1
to mapping_t_s
.c1
is in mapping_s_t
but does not map to c2
, or if c2
is in mapping_t_s
but does not map to c1
, return false
.false
, return true
.