Simple java code 1 ms beats 100 % && 42 mb beats 88.78 %
\n# Complexity\n\n- image.png\n# Code\n\nclass Solution {\n    public char help(char p,char n){\n        for(char c=\'b\';c<=\'y\';c++){\n            if(c!=p&&c
\n# Complexity\n![image.png](https://assets.leetcode.com/users/images/f383333f-b9b0-4ce5-a4f4-68239d004394_1711347757.5247393.png)\n- image.png\n# Code\n```\nclass Solution {\n    public char help(char p,char n){\n        for(char c=\'b\';c<=\'y\';c++){\n            if(c!=p&&c!=n)  return c;\n        }\n        return \'x\';\n    }\n    public String modifyString(String s) {\n        StringBuilder sb=new StringBuilder();\n        for(int i=0;i<s.length();i++){\n            if(s.charAt(i)==\'?\'){\n                char p=\'a\';\n                char n=\'z\';\n                if(i>0) p=sb.charAt(i-1);\n                if(i<s.length()-1)  n=s.charAt(i+1);\n                char c=help(p,n);\n                sb.append(c);\n            }\n            else{\n                sb.append(s.charAt(i));\n            }\n        }\n        return sb.toString();\n    }\n}\n```
['String', 'Java']