JavaScript
\nconst modifyString = s => {\n    for (let i = 0; i < s.length; i++){              //Iterating through the string\n        if (s[i] === \'?\'){                
```\nconst modifyString = s => {\n    for (let i = 0; i < s.length; i++){              //Iterating through the string\n        if (s[i] === \'?\'){                           //If a \'?\' is encountered\n            let rep = \'\';\n            if (s[i-1] !== \'a\' && s[i+1] !== \'a\') rep = \'a\';       //determine the replacement\n            else if (s[i-1] !== \'b\' && s[i+1] !== \'b\') rep = \'b\';\n            else rep = \'c\';\n            s = s.slice(0,i)+rep+s.slice(i+1);                    //and replace in string\n        }\n    }\n    return s;        //return modified string\n};\n```
[]