diff options
Diffstat (limited to 'codechef/SnakeProcession/main.cpp')
| -rw-r--r-- | codechef/SnakeProcession/main.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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<bits/stdc++.h> + +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; + } +} |
