This is a fairly simple challenge. Given a lower-case word, you must "interpolate" between letters. Here's some examples to hopefully clarify this:

Input: test Output: tsrqponmlkjihefghijklmnopqrst

Between letters you must add, in alphabetical order, the letters between those two letters. So if you have ad, you must output abcd. If you are given da, you must output dcba.

If the letters are next to each other in the alphabet, nothing happens:

Input: hi Output: hi

Assume the input contains a lower-case word consisting of ASCII letters only; no spaces, symbols, etc. The input is also never empty.

Lowest byte count wins; this is code-golf. If you have any questions please comment.

  • 3
    \$\begingroup\$ What is the output for too? tsrqpo, tsrqpoo, tsrqpooo, something else? \$\endgroup\$ Jan 30 '17 at 17:54
  • 4
    \$\begingroup\$ Duplicate? (numbers instead of characters). \$\endgroup\$
    – nimi
    Jan 30 '17 at 17:58
  • \$\begingroup\$ I agree that it's a duplicate - converting between ASCII characters and numbers is a minor difference. \$\endgroup\$
    – user45941
    Jan 30 '17 at 18:06
  • \$\begingroup\$ Unless McMastery clarifies on Jonathan's question and there is some significant difference regarding that \$\endgroup\$
    – Luis Mendo
    Jan 30 '17 at 18:08

05AB1E, 4 bytes


Try it online!

Honestly? I don't know why this works.

Ç    # Push characters as ASCII.
 Ÿ   # Supposed to be range from [a, .., b], apparently vectorizes on lists...
  çJ # Turn back into characters, join stack.

Not the answer you're looking for? Browse other questions tagged or ask your own question.