From 7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Sat, 25 Jun 2022 18:32:00 +0200 Subject: Solved a couple of problems from codechef and codeforces --- codechef/chefAndTheWildcardMatching/main.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 codechef/chefAndTheWildcardMatching/main.cpp (limited to 'codechef/chefAndTheWildcardMatching/main.cpp') diff --git a/codechef/chefAndTheWildcardMatching/main.cpp b/codechef/chefAndTheWildcardMatching/main.cpp new file mode 100644 index 0000000..c00adb4 --- /dev/null +++ b/codechef/chefAndTheWildcardMatching/main.cpp @@ -0,0 +1,26 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + string x; + string y; + cin >> x; + cin >> y; + bool ok = 1; + for(int i = 0; i < x.size(); i++) { + if(x[i] != '?' && y[i] != '?') { + if(x[i] != y[i]) { + ok = 0; + } + } + } + cout << (ok ? "Yes" : "No") << endl; + + } +} -- cgit v1.2.3