如果是连续的字符的话 parent['a' -'0'] = 'b' - '0'?,不连续那只能用哈希表 unordered_map<char, char>mp;mp[a] = b,连通分量的个数也可以?
点赞 评论

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务