🐌 C# - straightforward solution
\npublic class Solution\n{\n    public string ModifyString(string s)\n    {\n        char[] characters = s.ToCharArray();\n\n        for (int index = 0; index <
```\npublic class Solution\n{\n    public string ModifyString(string s)\n    {\n        char[] characters = s.ToCharArray();\n\n        for (int index = 0; index < characters.Length; index++)\n        {\n            if (characters[index] is not \'?\') continue;\n\n            char? previousCharacter = index > 0 ? characters[index - 1] : null;\n            char? nextCharacter = index + 1 < characters.Length ? characters[index + 1] : null;\n\n            if (previousCharacter is not \'a\' && nextCharacter is not \'a\')\n            {\n                characters[index] = \'a\';\n            }\n            else if (previousCharacter is not \'b\' && nextCharacter is not \'b\')\n            {\n                characters[index] = \'b\';\n            }\n            else\n            {\n                characters[index] = \'c\';\n            }\n        }\n\n        return new string(characters);\n    }\n}\n```\n\nWith switch expression\n```\npublic class Solution\n{\n    public string ModifyString(string s)\n    {\n        char[] characters = s.ToCharArray();\n\n        for (int index = 0; index < characters.Length; index++)\n        {\n            if (characters[index] is not \'?\') continue;\n\n            char? previousCharacter = index > 0 ? characters[index - 1] : null;\n            char? nextCharacter = index + 1 < characters.Length ? characters[index + 1] : null;\n\n            characters[index] = (previousCharacter, nextCharacter) switch\n            {\n                (not \'a\', not \'a\') => \'a\',\n                (not \'b\', not \'b\') => \'b\',\n                _ => \'c\'\n            };\n        }\n\n        return new string(characters);\n    }\n}\n```
['C#']