Computer Science & Engineering: Department of
Computer Science & Engineering: Department of
Experiment 1.4
Aim:
• To Solve the Word Pattern
• To Solve the Missing number
• Longest substring without repeating characters
Problem 1:
return false;
}
if (charToWord.count(pattern[i]) && charToWord[pattern[i]] != word) {
return false;
}
if (wordToChar.count(word) && wordToChar[word] != pattern[i]) {
return false;
}
charToWord[pattern[i]] = word;
wordToChar[word] = pattern[i];
++i;
}
return i == pattern.size();
}
};
Problem 2:
Problem 3:
return sol;
}
};
Learning Outcomes:
We learn about the concept of Hashing.
We learn about the implementation of hashing.