Python O(n) solution
We can simply start with converting string in to list of characters as string is immutable in python. Then iterate over each element in list if it is "?" check 
We can simply start with converting string in to list of characters as string is immutable in python. Then iterate over each element in list if it is "?" check previous and next value and replace it with any character apart from neighbours.\n    \n        `class Solution:\n    def modifyString(self, s: str) -> str:\n        s = list(s)\n        n = len(s)\n        i = 0\n        while i<n:\n            if s[i]=="?":\n                choice1 = choice2 = 0\n                if i>0:\n                    choice1 = ord(s[i-1])\n                if i<n-1:\n                    choice2 = ord(s[i+1])\n                val = 97\n                while val == choice1 or val == choice2:\n                    val+=1\n                s[i] = chr(val)\n            i +=1\n        return "".join(s)\n                    \n            \n        `\n \n            \n
[]