java.lang.Object
g0001_0100.s0017_letter_combinations_of_a_phone_number.Solution

public class Solution extends Object
17 - Letter Combinations of a Phone Number.<p>Medium</p> <p>Given a string containing digits from <code>2-9</code> inclusive, return all possible letter combinations that the number could represent. Return the answer in <strong>any order</strong>.</p> <p>A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.</p> <p><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Telephone-keypad2.svg/200px-Telephone-keypad2.svg.png" alt="" /></p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> digits = &ldquo;23&rdquo;</p> <p><strong>Output:</strong> [&ldquo;ad&rdquo;,&ldquo;ae&rdquo;,&ldquo;af&rdquo;,&ldquo;bd&rdquo;,&ldquo;be&rdquo;,&ldquo;bf&rdquo;,&ldquo;cd&rdquo;,&ldquo;ce&rdquo;,&ldquo;cf&rdquo;]</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> digits = &quot;&quot;</p> <p><strong>Output:</strong> []</p> <p><strong>Example 3:</strong></p> <p><strong>Input:</strong> digits = &ldquo;2&rdquo;</p> <p><strong>Output:</strong> [&ldquo;a&rdquo;,&ldquo;b&rdquo;,&ldquo;c&rdquo;]</p> <p><strong>Constraints:</strong></p> <ul> <li><code>0 <= digits.length <= 4</code></li> <li><code>digits[i]</code> is a digit in the range <code>['2', '9']</code>.</li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details