甲numeronym(也称为“数字收缩”)是当一个字使用数字缩短。一种常见的收缩方法是使用替换后的子字符串的长度来替换除第一个和最后一个字符以外的所有字符。例如,使用i18n
的代替internationalization
或,L10n
而不是localization
。(L
大写字母是因为小写字母看起来与相似1
)。
当然,同一个词组中的几个词可能具有相同的缩写形式,因此您的工作是将一组词转换为它们的别名,或者,如果存在一些具有相同词名的不同词,则程序应给出一个的A7s R4t
缩写,Ambiguous Result
是的(是的,我知道这个结果本身就是模棱两可的结果。)
规则:
- 使用程序或功能,然后打印或返回结果。
- 输入被视为单个字符串。
- 输出是由空格分隔的单词的单个字符串。
- 您的程序无需转换长度为3的单词,也不必转换较短的单词。
- 如果
l
(小写的ell)将在1
(一个)之前出现,则应将其设置为大写。 - 如果
I
(一只大写的眼睛)出现在1
(一只)之前,则应将其设为小写。 - 输入将是可打印的ASCII和空格。单词之间用空格隔开。
- 最短的代码获胜。
例子:
A7s R4t -> A7s R4t (OR: A1s R1t, etc)
Ambiguous Result -> A7s R4t
Billy goats gruff -> B3y g3s g3f
Thanks for the Memories -> T4s f1r the M6s (one possible answer, NOT: Thnks fr th Mmrs)
Programming Puzzles & Code Golf -> P9g P5s & C2e G2f
globalization -> g11n
localizability -> L12y
Internationalization or antidisestablishmentarianism -> i18n or a26m
Internationalization or InternXXXXXalization -> A7s R4t
what is this fiddle and faddle -> A7s R4t
A be see -> A be s1e (OR: A be see)
see sea -> s1e s1a (OR: see sea)
2B or not 2B -> 2B or not 2B (OR: 2B or n1t 2B. 2 letters, don't change, don't count as ambiguous)
this example is this example -> t2s e5e is t2s e5e (same words aren't ambiguous)
l1 -> l1 (2 letters, don't change.)
I1 -> I1 (2 letters, don't change.)
编辑:如果没有人得到参考:Thnks fr th Mmrs
example example
会e5e e5e
,但是这将是很好的,具有覆盖本测试用例。
2B or not 2B
及之后的问题)添加了测试用例
l1
变为L1
或保持为l1
?