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()的返回值來確定是否規(guī)則一致, 看代碼!


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,110評(píng)論 0 23
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc閱讀 2,993評(píng)論 0 0
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的閱讀 13,660評(píng)論 5 6
  • 每天醒來 重復(fù)前一天的故事 是墮落? 是輪回? 每一天睡下 回憶還沒做的事情 是迷茫? 是遺憾? 然后 突然有一天...
    空白畫筆閱讀 176評(píng)論 0 1
  • 天氣剛剛好,萬里藍(lán)天,白云輕柔。陽光如一縷縷的金色細(xì)流般從云層后滲漏出來,若佛光忽現(xiàn)人間,又似瀑布九天直下,甚是蔚...
    淺香笑閱讀 534評(píng)論 0 4

友情鏈接更多精彩內(nèi)容