C++ 0ms
```\nclass Solution {\npublic:\n    string modifyString(string s) {\n        int n = s.size();\n        for(int i=0;i=0)\n                    prev = s[i-1];\n  
```\nclass Solution {\npublic:\n    string modifyString(string s) {\n        int n = s.size();\n        for(int i=0;i<n;i++)\n        {\n            if(s[i] == \'?\')\n            {\n                char c = \'a\';\n                char prev = \'a\',next = \'a\';\n                if(i-1 >=0)\n                    prev = s[i-1];\n                if(i+1 < n)\n                    next = s[i+1];\n                while(c == prev || c == next)\n                    c++;\n                s[i] = c;\n            }\n        }\n        return s;   \n    }\n};
[]