diff --git a/Day-19/q3-Letter Combinations of a Phone Number/Shubhra-Narang--c.md b/Day-19/q3-Letter Combinations of a Phone Number/Shubhra-Narang--c.md new file mode 100644 index 00000000..6378f36c --- /dev/null +++ b/Day-19/q3-Letter Combinations of a Phone Number/Shubhra-Narang--c.md @@ -0,0 +1,33 @@ +``` +class Solution { +public: + void generate(string &digits, int i,string &t, vector&ans, vector>&m){ + if(i==digits.size()){ + ans.push_back(t); + return; + } + for(int j=0;j letterCombinations(string digits) { + vectorans; + int n=digits.size(); + if(n==0)return ans; + vector>m; + m.push_back({'a','b','c'}); + m.push_back({'d','e','f'}); + m.push_back({'g','h','i'}); + m.push_back({'j','k','l'}); + m.push_back({'m','n','o'}); + m.push_back({'p','q','r','s'}); + m.push_back({'t','u','v'}); + m.push_back({'w','x','y','z'}); + string t=""; + generate(digits,0,t,ans,m); + return ans; + } +}; +```