From dd684349c67c988ef19707cb65e637b6906fac75 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Fri, 8 Jul 2022 19:54:42 +0200 Subject: Solved some new problems --- codechef/ChefAndFeedBack/main.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 codechef/ChefAndFeedBack/main.cpp (limited to 'codechef/ChefAndFeedBack/main.cpp') diff --git a/codechef/ChefAndFeedBack/main.cpp b/codechef/ChefAndFeedBack/main.cpp new file mode 100644 index 0000000..8f04fc8 --- /dev/null +++ b/codechef/ChefAndFeedBack/main.cpp @@ -0,0 +1,24 @@ +#include + + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + string str1 = "010"; + string str2 = "101"; + while(tt--){ + string s; + cin >> s; + int found1 = s.find(str1); + int found2 = s.find(str2); + if(found1 != string::npos || found2 != string::npos) { + cout << "Good" << endl; + } else { + cout << "Bad" << endl; + } + } +} -- cgit v1.2.3