Skip to content

Commit 96020fb

Browse files
authored
Merge pull request #161 from chenkkkabc/patch-1
Update encrypt-and-decrypt-strings.cpp
2 parents 0fd237b + b849e65 commit 96020fb

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)