Opening your workspace…
Workspace/Coding room
Opening your workspace…
Vera can read a page even after the ink moths have had supper. A pinhole (?) has eaten exactly one letter. A long silver trail (*) may have eaten any number of letters, including none. Every surviving lowercase letter must match itself. Given a damaged pattern and a guest's name, return whether the pattern could account for the whole name. Practice rank · 4 kyu (Brewery estimate).
"m*?", "moss"OUTPUTtrueThe m survives, the trail covers os, and the pinhole takes the final s.
"?m", "m"OUTPUTfalseThere is no spare letter for the pinhole.
For a silver trail, try eating nothing or extending an existing trail by one letter.
function solve(pattern, name) { // 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.
"m*?", "moss"true