EASY C++ solution with comments || O(n)
\nclass Solution {\npublic:\n    string modifyString(string s) {\n        for(int i = 0;i < s.size();i++){\n            if(s[i] == \'?\'){\n                \n  
```\nclass Solution {\npublic:\n    string modifyString(string s) {\n        for(int i = 0;i < s.size();i++){\n            if(s[i] == \'?\'){\n                \n                if(i == 0){    // if we are starting then we have to check only next character\n                    if(i + 1 < s.size()){\n                        if(s[i+1] != \'a\') s[i] = \'a\';\n                        else s[i] = \'b\';\n                    } \n                    else s[i] = \'a\';\n                }\n                \n                else if(i == s.size() - 1){     // if we are at last position\n                    if(s[i-1] != \'a\') s[i] = \'a\';\n                    else s[i] = \'b\';\n                }\n                \n                else{\n                    if(s[i + 1] != \'a\' && s[i-1] != \'a\') s[i] = \'a\';\n                    else if(s[i + 1] != \'b\' && s[i-1] != \'b\') s[i] = \'b\';\n                    else s[i] = \'c\';\n                }\n                \n            }\n        }\n        return s;\n    }\n};\n```
[]