@@ -0,0 +1,1434 @@
+package leetcode;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/%0A */%0Apublic class Problem17 %7B%0A    public List%3CString%3E letterCombinations(String digits) %7B%0A        List%3CString%3E result = new ArrayList%3C%3E();%0A        Map%3CInteger, List%3CCharacter%3E%3E numbers = new HashMap%3C%3E();%0A        numbers.put(2, Arrays.asList('a', 'b', 'c'));%0A        numbers.put(3, Arrays.asList('d', 'e', 'f'));%0A        numbers.put(4, Arrays.asList('g', 'h', 'i'));%0A        numbers.put(5, Arrays.asList('j', 'k', 'l'));%0A        numbers.put(6, Arrays.asList('m', 'n', 'o'));%0A        numbers.put(7, Arrays.asList('p', 'q', 'r', 's'));%0A        numbers.put(8, Arrays.asList('t', 'u', 'v'));%0A        numbers.put(9, Arrays.asList('w', 'x', 'y', 'z'));%0A        %0A        letterCombinations(digits, numbers, 0, %22%22, result);%0A        %0A        return result;%0A    %7D%0A%0A    private void letterCombinations(String digits,%0A        Map%3CInteger, List%3CCharacter%3E%3E numbers, int n, String accu,%0A        List%3CString%3E result) %7B%0A        if (n == digits.length()) %7B%0A            result.add(accu);%0A            return;%0A        %7D%0A        int digit = Integer.parseInt(Character.toString(digits.charAt(n)));%0A        for (Character c : numbers.get(digit)) %7B%0A            letterCombinations(digits, numbers, n+1, accu+c, result);%0A        %7D%0A    %7D%0A%7D%0A

Solve problem 17