3
string evaluate(string s, vector<vector<string>> &knowledge) {4
string ans; // resultant string6
if (n < 2) return s; // because () will come in pair so, size should be more than 27
int sz = knowledge.size();8
unordered_map<string, string> mp; // To reduce Runtime otherwise it will give TLE9
for (int i = 0; i < sz; ++i) {10
mp.insert({knowledge[i][0], knowledge[i][1]}); // Inserting {key, value} pair12
for (int i = 0; i < n; i++) {16
while (s[i] != ')') { // getting key till we get ')'20
if (mp.find(key) != mp.end()) { // If {key, value} pair is present then21
// replace (key) by it's value24
} else { // otherwise replace (key) by ?