205. Isomorphic Strings

Given two stringssandt, determine if they are isomorphic.
Two strings are isomorphic if the characters inscan be replaced to gett.
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.

For example,
Given"egg","add", return true.
Given"foo","bar", return false.
Given"paper","title", return true.

这题厉害了, 利用map.put()的返回值来确定是否规则一致, 看代码!


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,920评论 0 23
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,982评论 0 0
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,634评论 5 6
  • 每天醒来 重复前一天的故事 是堕落? 是轮回? 每一天睡下 回忆还没做的事情 是迷茫? 是遗憾? 然后 突然有一天...
    空白画笔阅读 174评论 0 1
  • 天气刚刚好,万里蓝天,白云轻柔。阳光如一缕缕的金色细流般从云层后渗漏出来,若佛光忽现人间,又似瀑布九天直下,甚是蔚...
    浅香笑阅读 522评论 0 4

友情链接更多精彩内容