• [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

  • 相关阅读:
    Mysql开启日志
    amfphp传递负数的bug
    linux /var/spool/clientmqueue 目录占大量空间
    WinXP SSH连接不上虚拟机的解决方法
    批量数据替换助手V1.0版发布
    也谈反射的应用场景
    反射+特性打造简洁的AJAX调用
    文本处理之利器正则表达式闪亮登场
    关于缩略图的生成与访问策略的一些经验分享
    装饰模式个人的一些理解
  • 原文地址:https://www.cnblogs.com/lz87/p/7494036.html
Copyright © 2020-2023  润新知