Python O(n) time | O(n) Space
\n# Time = O(n)\n# Space = O(n)\nclass Solution:\n    def modifyString(self, s: str) -> str:\n        d = {}\n        s = list(s)\n\n        for i in range(len(
```\n# Time = O(n)\n# Space = O(n)\nclass Solution:\n    def modifyString(self, s: str) -> str:\n        d = {}\n        s = list(s)\n\n        for i in range(len(s)):\n            if s[i] != \'?\':\n                d[s[i]] = i \n                continue \n                \n            for j in range(1, 26+1):\n                char = chr(96 + j)\n                if (i > 0 and s[i-1] == char) or (i < len(s) - 1 and s[i+1] == char):\n                    continue \n                    \n                s[i] = char \n                d[char] = i \n                break \n                    \n        return \'\'.join(s)\n\t\t```
[]