class Solution {
public:
vector<string> res;
vector<string> v = {"", "" ,"abc", "def", "ghi", "jkl","mno","pqrs","tuv","wxyz"};
vector<string> letterCombinations(string digits) {
if(digits.empty() || digits == "") return res;
findCombinations(digits, 0, "");
return res;
}
void findCombinations(string digits, int index, string s)
{
if(index == digits.size()){
res.push_back(s);
return ;
}
string str = v[digits[index] - '0'];
for(int i = 0 ; i < str.size(); i++){
findCombinations(digits, index + 1, s + str[i]);
}
return ;
}
};
03-30
3599
07-13
2286
09-21