| 11 | //User function Template for C++ |
| 12 | |
| 13 | class Solution |
| 14 | { |
| 15 | public: |
| 16 | vector<string> keys = {"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; |
| 17 | vector<string> ans; |
| 18 | //Function to find list of all words possible by pressing given numbers. |
| 19 | void helper(int a[],int n,string temp,int i){ |
| 20 | if (i==n){ |
| 21 | ans.push_back(temp); |
| 22 | return; |
| 23 | } |
| 24 | for (int j=0;j<keys[a[i]].size();j++){ |
| 25 | helper(a,n,temp+keys[a[i]][j],i+1); |
| 26 | } |
| 27 | } |
| 28 | vector<string> possibleWords(int a[], int N) |
| 29 | { |
| 30 | //Your code here |
| 31 | helper(a,N,"",0); |
| 32 | return ans; |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | |
| 37 | // { Driver Code Starts. |
nothing calls this directly
no outgoing calls
no test coverage detected