[Java] Straightforward solution, beats 100%
Time Complexity: O(n)\nSpace Complexity: O(n)\n```\nclass Solution {\n    public String modifyString(String s) {\n        StringBuilder sb = new StringBuilder()
Time Complexity: O(n)\nSpace Complexity: O(n)\n```\nclass Solution {\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                sb.append(s.charAt(i));\n            }else{\n                sb.append(getChar(i>0?sb.charAt(i-1):\'\\0\',i<s.length()-1?s.charAt(i+1):\'\\0\'));\n            }\n        }\n        return sb.toString();\n    }\n    \n    private char getChar(char prev, char next){\n        char c=\'a\';\n        while(c<=\'z\'){\n            if(c==prev || c==next)\n                c++;\n            else\n                break;\n        }\n        return c;\n    }\n}
[]