2
\$\begingroup\$

This question already has an answer here:

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.

\$\endgroup\$

marked as duplicate by Luis Mendo, Mego code-golf Jan 30 '17 at 18:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    \$\begingroup\$ What is the output for too? tsrqpo, tsrqpoo, tsrqpooo, something else? \$\endgroup\$ – Jonathan Allan 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\$ – Mego 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
2
\$\begingroup\$

05AB1E, 4 bytes

ÇŸçJ

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.
\$\endgroup\$

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