// Given a digit string, return all possible letter combinations that the number could represent.

// A mapping of digit to letters (just like on the telephone buttons) is given below.

// 1    2     3
//     abc   def

//  4    5    6
// ghi  jkl  mno

//  7    8    9
// pqrs tuv  wxyz

// Input: Digit string "23"
// Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].


@@ -378,8 +378,1058 @@
 %22cf%22%5D.%0A%0A
+var letterCombinations = function(digits) %7B%0A     var letterLib = %5B%5D;%0A         letterLib%5B2%5D=%22abc%22;%0A         letterLib%5B3%5D=%22def%22;%0A         letterLib%5B4%5D=%22ghi%22;%0A         letterLib%5B5%5D=%22jkl%22;%0A         letterLib%5B6%5D=%22mno%22;%0A         letterLib%5B7%5D=%22pqrs%22;%0A         letterLib%5B8%5D=%22tuv%22;%0A         letterLib%5B9%5D=%22wxyz%22;%0A         letterLib%5B0%5D=%22%22;%0A    var result = %5B%5D;%0A    if(digits === null %7C%7C digits.length === 0)%7B%0A        return result;%0A    %7D%0A    var temp = %5B%5D;%0A    getString(digits, temp, result, letterLib);%0A    return result;%0A%7D;%0A%0Afunction getString(digits, temp, result, letterLib)%7B%0A    if(digits.length === 0)%7B%0A        var arr = %5B%5D;%0A        for(var i=0; i%3Ctemp.length; i++)%7B%0A            arr%5Bi%5D = temp%5Bi%5D;%0A        %7D%0A        result.push(arr.join(''));%0A        return;%0A    %7D%0A%0A    var curr = parseInt(digits.substring(0,1));%0A    var letters = letterLib%5Bcurr%5D;%0A    for(var i=0; i%3Cletters.length; i++)%7B%0A        temp.push(letters.charAt(i));%0A        getString(digits.substring(1), temp, result, letterLib);%0A        temp.pop();%0A    %7D%0A%7D%0A%0A// -----------------------------%0A

add solution