Easy Solution for beginners || Beats 100%+✨ || ✌️🥱
\n# Approach:\n Describe your approach to solving the problem. \nTo solve this, we turn the string into a list to easily change its characters. As we go through
\n# Approach:\n<!-- Describe your approach to solving the problem. -->\n*To solve this, we turn the string into a list to easily change its characters. As we go through the string, we replace each `\'?\'` with a letter, making sure it\u2019s different from its neighbors. For the first and last characters, we only check one side. Once all the `\'?\'` are replaced, we join the list back into a string and return it, ensuring no two adjacent characters are the same.*\n\n# Complexity\n- Time complexity: **O(N)**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: **O(N)**\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def modifyString(self, s: str) -> str:\n        l=[\'a\',\'b\',\'c\',\'d\',\'e\',\'f\',\'g\',\'x\',\'q\']\n        s=list(s)\n        for i in range(len(s)):\n            if s[i]==\'?\':\n                for j in range(len(l)):\n                    if (i == 0 or s[i-1] != l[j]) and (i == len(s)-1 or s[i+1] != l[j]):\n                        s[i] = l[j]\n                        break\n        return \'\'.join(s)\n\n```
['Python', 'Python3']