//// Created by bleedingfight on 2020年7月5日.//#include "isIsomorphic.h"std::string map2str(std::string& s){int length = s.size();std::string result;std::map<char,int>chars;for(int ch_index = 0;ch_index<length;ch_index++){if(!chars.count(s.at(ch_index))){result+=char(ch_index);chars[s.at(ch_index)] = ch_index;} elseresult+=char(chars[s.at(ch_index)]);}return result;}bool isIsomorphic(std::string s, std::string t){return map2str(s) == map2str(t);}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。