【leetcode题解】电话号码的字母组合
作者:互联网
题目链接
题目描述
个人想法:
DFS
代码:
知识点:
- unordered_map
存储的时候根据key的hash值判断元素是否相同,内部元素是无序。
相关操作:
初始化
unordered_map<char, string> mp = {
{'a', "hello"},
{'b', "world"}
};
取某一个键对应值(也可以采用数组遍历方式)
cout << mp.at('a') << endl;
插入某个值
mp.insert({'c',"nihao"});
标签:map,题目,题解,unordered,mp,电话号码,字母组合,leetcode 来源: https://blog.csdn.net/m0_47746932/article/details/120408188