easy java random solution
\nclass Solution {\n    Map<Integer, Character> map = new HashMap();\n    Random rand = new Random();\n    \n    public String modifyString(String s) {\n       
```\nclass Solution {\n    Map<Integer, Character> map = new HashMap();\n    Random rand = new Random();\n    \n    public String modifyString(String s) {\n        char[] ch = s.toCharArray();\n        map.put(0, \'a\');\n        map.put(1, \'b\');\n        map.put(2, \'c\');\n        map.put(3, \'d\');\n        map.put(4, \'e\');\n        map.put(5, \'f\');\n        map.put(6, \'g\');\n        map.put(7, \'h\');\n        map.put(8, \'j\');\n        map.put(9, \'i\');\n        map.put(10, \'j\');\n        map.put(11, \'k\');\n        map.put(12, \'l\');\n        map.put(13, \'m\');\n        map.put(14, \'n\');\n        map.put(15, \'o\');\n        map.put(16, \'p\');\n        map.put(17, \'r\');\n        map.put(18, \'s\');\n        map.put(19, \'t\');\n        map.put(20, \'u\');\n        map.put(21, \'v\');\n        map.put(22, \'w\');\n        map.put(23, \'x\');\n        map.put(24, \'y\');\n        map.put(25, \'z\');\n\n        if(s.length() == 1){\n            if( s.charAt(0) == \'?\')\n                return String.valueOf(\'a\');\n        }\n        char cand;\n        for(int i = 0 ; i < ch.length; i++) {\n            if(ch[i] == \'?\'){\n                if(i - 1 >= 0 && i+1 <= ch.length -1){\n                    do{\n                        cand = getRandomChar();\n                    }while(ch[i+1] == cand || ch[i-1] == cand);\n                    ch[i] = cand;\n                }\n                else if(i == 0){\n                    do{\n                        cand = getRandomChar();\n                    }while(ch[i+1] == cand);\n                    ch[i] = cand;\n                }\n                else if(i == ch.length-1){\n                    do{\n                        cand = getRandomChar();\n                    }while(ch[i-1] == cand);\n                    ch[i] = cand;\n                }\n            }\n        }\n        return new String(ch);\n    }\n    \n    public char getRandomChar(){\n       return map.get(rand.nextInt(26));\n    }\n}\n```
['Java']