Very Simple C++ Solution | 100% Faster 0ms
\nclass Solution {\npublic:\n    \n    char fun(char cp, char cn)\n    {\n        for(int i=0; i<26; i++)\n        {\n            char c = i +\'a\';\n          
```\nclass Solution {\npublic:\n    \n    char fun(char cp, char cn)\n    {\n        for(int i=0; i<26; i++)\n        {\n            char c = i +\'a\';\n            if(cp!=c && cn!=c)\n            {\n                return c;\n            }\n        }\n        return 0;\n    }\n    string modifyString(string s) {\n        ios:: sync_with_stdio(0); cin.tie(0); cout.tie(0);\n        if(s[0] ==\'?\')\n        {\n            for(int i=0; i<26; i++)\n            {\n                char c = i+\'a\';\n                if(s[1]!=c)\n                {\n                    s[0]=c;\n                    break;\n                }\n            }\n        }\n        if(s[s.size()-1]==\'?\')\n        {\n           for(int i=0; i<26; i++)\n            {\n                char c = i+\'a\';\n                if(s[s.size()-2]!=c)\n                {\n                    s[s.size()-1]=c;\n                    break;\n                }\n            } \n        }\n        \n        for(int i=1; i<s.size()-1; i++)\n        {\n            if(s[i]==\'?\')\n            {\n                char cp = s[i-1];\n                char cn = s[i+1];\n                char ans = fun(cp, cn);\n                s[i] = ans;\n            }\n        }\n        return s;\n    }\n};\n```
[]