simple C++ solution
\nclass Solution {\npublic:\n    string modifyString(string s) \n    {\n        int len=s.length();\n        char ch;\n        \n        for(int i=0;i<len;i++)\
```\nclass Solution {\npublic:\n    string modifyString(string s) \n    {\n        int len=s.length();\n        char ch;\n        \n        for(int i=0;i<len;i++)\n        {\n            ch=\'a\';\n            if(s[i]==\'?\')\n            {\n                if(i==0)\n                {\n                    while(ch==s[i+1])\n                        ch++;                    \n                }\n                else if(i==len-1)\n                {\n                    while(ch==s[i-1])\n                        ch++;\n                }\n                else\n                {\n                    while(ch==s[i+1]||ch==s[i-1])\n                       ch++;\n                }\n                s[i]=ch;\n                \n            }\n        }\n        return s;\n    }\n};\n```
[]