Skip to content

Commit b849e65

Browse files
authored
Update encrypt-and-decrypt-strings.cpp
1 parent 0fd237b commit b849e65

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

C++/encrypt-and-decrypt-strings.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Encrypter {
1818
string encrypt(string word1) {
1919
string result;
2020
for (const auto& c : word1) {
21+
if (!lookup_.count(c)) return "";
2122
result += lookup_[c];
2223
}
2324
return result;

0 commit comments

Comments
 (0)