Skip to content

Latest commit

 

History

History
60 lines (33 loc) · 1.29 KB

README_EN.md

File metadata and controls

60 lines (33 loc) · 1.29 KB

中文文档

Description

On old cell phones, users typed on a numeric keypad and the phone would provide a list of words that matched these numbers. Each digit mapped to a set of 0 - 4 letters. Implement an algo­rithm to return a list of matching words, given a sequence of digits. You are provided a list of valid words. The mapping is shown in the diagram below:

Example 1:

Input: num = "8733", words = ["tree", "used"]

Output: ["tree", "used"]

Example 2:

Input: num = "2", words = ["a", "b", "c", "d"]

Output: ["a", "b", "c"]

Note:

  • num.length <= 1000
  • words.length <= 500
  • words[i].length == num.length
  • There are no number 0 and 1 in num.

Solutions

Python3

Java

...