c++ simple solution 100% beats in 0ms.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1- iterate over the str
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1- iterate over the string.\n2-than make a function of default arguments to handle multiple cases in one function.\n3-function contain a for loop fron a to z.\n4-if(i th charecter doesnt match with both the s[i-1] and s[i+1])\nvalue the assing the ith charecter value in position of ?. \n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    void ans(string &str, int pos, char a=\' \', char b=\' \')\n    {\n        for(int  i=\'a\'; i<=\'z\'; i++)\n        {\n            if((char)i !=a && (char)i!=b)\n            {\n                str[pos]=char(i);\n                return ;\n            }\n        }\n    }\n    string modifyString(string s) {\n        for(int i=0 ; i<s.length(); i++)\n        {\n            if(i==0)\n            {\n                if(s[i]==\'?\' )\n                {\n                    ans(s,i,s[i+1]);\n                }\n            }\n            else if(i==s.length()-1)\n            {\n                if(s[i]==\'?\' )\n                {\n                    ans(s,i,s[i-1]);\n                }\n            }\n            else\n            {\n                if(s[i]==\'?\' )\n                {\n                    ans(s,i,s[i-1],s[i+1]);\n                }\n            }\n        }\n        return s;\n    }\n};\n```
['C++']