Opening your workspace…
Workspace/Coding room
Opening your workspace…
Pip knits a letter into every stitch of a scarf. For delivery he folds it end to end and pins a note at the crease. On an odd-length scarf he copies the one middle letter. On an even-length scarf he copies the two letters touching the fold, in their original order. Given scarf, return what Pip writes on the note.
"WOOL"OUTPUT"OO"The crease falls between the two Os.
"cAbLe"OUTPUT"b"Two stitches on either side leave b at the fold.
Imagine crossing out the two ends until only one or two letters remain.
/** @param {string} scarf * @returns {string} */ function solve(scarf) { // Write your answer here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.
"WOOL""OO"