电话词的问题 [英] Telephone Words problem

查看:159
本文介绍了电话词的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮忙解决这个问题:

电话号码往往被赋予了为重新presentation一个字,让他们很容易记住。例如,如果我的电话号码是 4357 ,中的文字是帮助。可能有许多其它的可能性用相同的数字,其中大部分是没有意义。

Telephone numbers are often given out as a word representation, so that they are easy to remember. For example if my number is 4357, the text given is HELP. There could be many other possibilities with the same digits, most of which do not make sense.

写空间和时间优化的函数,可以给定一个电话号码,打印可以从它形成的可能的话。

Write a space-and-time-optimal function that can, given a phone number, print the possible words that can be formed from it.

推荐答案

根据详细的说明,在评论这应该是一个简单的排列组合问题: 每个数位将具有多个与之关联的字符(例如4可能意味着要么G,H或I),然后对数字的置换可以计算的组合。

Based on the detailed explanation in the comment this should be a simple permutation combination problem: Each digit will have a number of characters associated to it (example 4 could mean either of G,H or I) and then for a combination of digits the permutation can be computed.

这篇关于电话词的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆