Java Straightforward Solution
\nclass Solution {\n    public String modifyString(String s) {\n        char[] res = s.toCharArray();\n        for(int i = 0; i < res.length; i++) {\n          
```\nclass Solution {\n    public String modifyString(String s) {\n        char[] res = s.toCharArray();\n        for(int i = 0; i < res.length; i++) {\n            char c = res[i];\n            if(c == \'?\') {\n                char repl = \'a\';\n                while((i > 0 && res[i - 1] == repl)\n                     || (i < res.length - 1 && res[i + 1] == repl)) {\n                    repl++;\n                }\n                res[i] = repl;\n            } \n        }\n        return String.valueOf(res);\n    }\n}\n```
[]