[C++] Concise Solution Using string::find
Search for every ? in the string, assigning it either a, b, or c depending on the adjacent values.\n\nstring modifyString(string s) {\n\tfor (int i = s.find(\'?
Search for every `?` in the string, assigning it either `a`, `b`, or `c` depending on the adjacent values.\n```\nstring modifyString(string s) {\n\tfor (int i = s.find(\'?\'); i != string::npos; i = s.find(\'?\', i + 1)) {\n\t\tchar prev = i > 0 ? s[i - 1] : 0, next = i < s.size() - 1 ? s[i + 1] : 0;\n\t\ts[i] = (prev == \'a\' || next == \'a\') ? ((prev == \'b\' || next == \'b\') ? \'c\' : \'b\') : \'a\';\n\t}\n\treturn s;\n}\n```
[]