zoukankan      html  css  js  c++  java
  • [LintCode] Letter Combinations of a Phone Number

    Given a digit string excluded 01, 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.

    Cellphone

    Although the above answer is in lexicographical order, your answer could be in any order you want.

    The order of letter combinations is dicated by the given digit string order. For the given example "23", any of 2's mapping{a, b, c} must appear before any of 3's mapping{d, e, f};

    Thus line 18 picks one letter mapping of a digit, add it to the string buffer, then proceed to repeat the same process on the next digit. The output condition is that we've picked 

    one mapping for each digit. 

    Example

    Given "23"

    Return ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]

    Related Problems

  • 相关阅读:
    thinkPHP框架学习笔记
    ajax的项目实操(只用于记录部分文件未引入)
    js中两个感叹号的原理与用法分析(转载记录没找到原帖)
    html5+css3学习笔记-prefixfree前缀补全插件
    背景图动起来就这么简单!
    flash设计师罢工,小前端顶上
    onbeforeunload与a标签在IE中的冲突bug(转载)
    js自定义的简易滚动条
    2020牛客国庆集训派对day2
    马拉车算法 Manacher
  • 原文地址:https://www.cnblogs.com/lz87/p/7494036.html
Copyright © 2011-2022 走看看