The string abcdefghijklmno, with length 24-1, can be formatted as such:
h
/ \
/ \
/ \
d l
/ \ / \
b f j n
a c e g i k m o
Each letter should be kept in the same column, but raised up by the right amount to form the above tree structure. Then, slashes (and backslashes) should be added to link each node to the two below. No slashes should be added between the bottom two rows.
Your challenge is to, given a string of lowercase letters of length 2k-1, format it as such. This is code-golf, shortest wins!
Testcases
| Input | Output |
|---|---|
a |
|
bcd |
|
hellowo |
|
abcdefghijklmno |
|
thistestcasehasalengththirtyone |
|