Understanding isomorphic strings algorithm

后端 未结 4 1247
梦谈多话
梦谈多话 2021-01-27 08:15

I am understanding the following code to find if the strings are isomorphic or not. The code uses two hashes s_dict and t_dict respectively. I am assum

4条回答
  •  孤城傲影
    2021-01-27 08:37

    One simple example, your code doesn't work on s='ab',t='aa'.

    Basically you have to have both way to be isomorphic. Your code only checked that t can be modified from s, but not the other way around.

提交回复
热议问题