From a5ae4c73079700cbb24bf0e1a07f688a8e5911de Mon Sep 17 00:00:00 2001 From: ashutosh Date: Mon, 15 Apr 2024 01:49:07 +0530 Subject: [PATCH] chore: solved medium day 12 task --- Medium/Day12/Solution.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Medium/Day12/Solution.cpp b/Medium/Day12/Solution.cpp index fc13810..8deaa4a 100644 --- a/Medium/Day12/Solution.cpp +++ b/Medium/Day12/Solution.cpp @@ -1 +1,30 @@ -// Write Your Code Here \ No newline at end of file +// Write Your Code Here +#include +#include +#include +typedef long long int ll; +#define MOD 998244353 +using namespace std; + + +int main(){ + int t; + cin>>t; + while(t--){ + string s; + cin>>s; + + int n=s.length(); + vector vec(n); + vec[0]=1; + vec[1]= vec[0]+ (s[0]!=s[1]); + for(int i=2; i