Spelling it Out

Published by Helen Yu in

Create a function which takes in a word and spells it out, by consecutively adding letters until the full word is completed.

Examples

spelling("bee") ➞ ["b", "be", "bee"]

spelling("happy") ➞ ["h", "ha", "hap", "happ", "happy"]

spelling("eagerly") ➞ ["e", "ea", "eag", "eage", "eager", "eagerl", "eagerly"]

Notes

N/A

Watch a quick demo on how Edabit works.