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/SnakeProcession/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 codechef/SnakeProcession/main.cpp (limited to 'codechef/SnakeProcession/main.cpp') diff --git a/codechef/SnakeProcession/main.cpp b/codechef/SnakeProcession/main.cpp new file mode 100644 index 0000000..cad706e --- /dev/null +++ b/codechef/SnakeProcession/main.cpp @@ -0,0 +1,18 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + string s; + cin >> s; + bool ans = regex_match(s, regex("(\\.*H\\.*T\\.*)*|(\\.*)")); + cout << (ans ? "Valid" : "Invalid") << endl; + } +} -- cgit v1.2.3