javaScript, Simple Solution
var modifyString = function (s) {\n  let arr = s.split("");\n  for (let i = 0; i <= arr.length; i++) {\n    let res = ["a", "b", "c"];\n    if (arr[i] === "?") 
var modifyString = function (s) {\n  let arr = s.split("");\n  for (let i = 0; i <= arr.length; i++) {\n    let res = ["a", "b", "c"];\n    if (arr[i] === "?") {\n      if (arr[i - 1] === "a" || arr[i + 1] === "a") {\n        res.splice(res.indexOf("a"), 1);\n      }\n      if (arr[i - 1] === "b" || arr[i + 1] === "b") {\n        res.splice(res.indexOf("b"), 1);\n      }\n      arr[i] = res[0];\n    }\n  }\n  return arr.join("");\n};
['JavaScript']