[C++] 0ms Concise Solution | 5 lines | Beats 100% Time
\n    string modifyString(string s) {\n        for(int i = 0; i < s.length(); i++){\n            if(s[i] == \'?\'){\n                if((i == 0 || s[i - 1] != \
```\n    string modifyString(string s) {\n        for(int i = 0; i < s.length(); i++){\n            if(s[i] == \'?\'){\n                if((i == 0 || s[i - 1] != \'a\') && (i == s.length() - 1 || s[i + 1] != \'a\')) s[i] = \'a\';  \n                else if((i == 0 || s[i - 1] != \'b\') && (i == s.length() - 1 || s[i + 1] != \'b\')) s[i] = \'b\';\n                else if((i == 0 || s[i - 1] != \'c\') && (i == s.length() - 1 || s[i + 1] != \'c\')) s[i] = \'c\';\n            }\n        }\n        return s;\n    }\n```
['C', 'C++']