Python simple single pass solution, Time: O(n)
\nclass Solution:\n    def modifyString(self, s: str) -> str:\n        output = ""\n        \n        for index in range(len(s)):\n            if s[index] != \'
```\nclass Solution:\n    def modifyString(self, s: str) -> str:\n        output = ""\n        \n        for index in range(len(s)):\n            if s[index] != \'?\':\n                output += s[index]    \n                continue\n\n            not_allowed = set()\n            \n            if index - 1 >= 0:\n                not_allowed.add(output[-1])\n            \n            if index + 1 < len(s) and s[index + 1] != \'?\':\n                not_allowed.add(s[index+1])\n            \n            if \'a\' not in not_allowed:\n                output += \'a\'\n            elif \'b\' not in not_allowed:\n                output += \'b\'\n            else:\n                output += \'c\'\n        return output\n```
[]