100% beats in c++ solution.
IntuitionApproachComplexity
Time complexity:O(N)

Space complexity:O(N)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:O(N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(N)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    string modifyString(string s) {
        if(s.size()==1){
            if(s[0]=='?'){
                s[0]='s';
            }
            return s;
        }
        string s1;
        for(int ch='a';ch<='z';ch++){
            s1+=ch;
        }
        for(int i=1;i<s.size();i++){
           if(s[i]=='?'){
                for(int j=0;j<s1.size();j++){
                   if(s1[j]!=s[i-1]&&s1[j]!=s[i+1]){
                       s[i]=s1[j];
                       break;
                   }
                }
           }
        }
        if(s[0]=='?'){
            if(s[1]=='z'){
                s[0]='a';
            }
            else{
                s[0]=s[1]+1;
            }
        }
        if(s[s.size()-1]=='?'){
            if(s[s.size()-2]=='z'){
                s[s.size()-1]='a';
            }
            else{
                s[s.size()-1]=s[s.size()-2]+1;
            }
        }
        return s;
    }
};
```
['C++']