From c51f805b2f20cc59311f4f5ba01c3b4aa14626b6 Mon Sep 17 00:00:00 2001 From: Ritish04 <74609026+Ritish04@users.noreply.github.com> Date: Sun, 27 Feb 2022 15:29:04 +0530 Subject: [PATCH 1/3] Create Ritish04_gameofcodes_Ps-1 --- .../Solution/Ritish04_gameofcodes_Ps-1 | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Problem Statement-1/Solution/Ritish04_gameofcodes_Ps-1 diff --git a/Problem Statement-1/Solution/Ritish04_gameofcodes_Ps-1 b/Problem Statement-1/Solution/Ritish04_gameofcodes_Ps-1 new file mode 100644 index 0000000..cd2673f --- /dev/null +++ b/Problem Statement-1/Solution/Ritish04_gameofcodes_Ps-1 @@ -0,0 +1,28 @@ +#include + +using namespace std; + +int main() +{ + int t; + cin>>t; + while(t--){ + int n,a,b,k; + cin>>n>>a>>b>>k; + int count,ans=0; + int ar[n]; + for(int i=0;i>ar[i]; + } + for(int i=0;i=k)cout<<"Win"< Date: Sun, 27 Feb 2022 17:50:04 +0530 Subject: [PATCH 2/3] Create Ritish04_gameofcodes_Ps-3 --- .../Solution/Ritish04_gameofcodes_Ps-3 | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Problem Statement-3/Solution/Ritish04_gameofcodes_Ps-3 diff --git a/Problem Statement-3/Solution/Ritish04_gameofcodes_Ps-3 b/Problem Statement-3/Solution/Ritish04_gameofcodes_Ps-3 new file mode 100644 index 0000000..b9f37cc --- /dev/null +++ b/Problem Statement-3/Solution/Ritish04_gameofcodes_Ps-3 @@ -0,0 +1,48 @@ +#include +using namespace std; +// Recursive function to return gcd of a and b +int gcd(int a, int b,int arr[]) +{ +// int arr[n]; +// for(i=0;i>arr[i]; +// } +int i=0; +a=arr[i]; + b=arr[i+1]; + if (a == 0) + return b; + if (b == 0) + return a; + + if (a == b) + return a; + + if (a > b) + return gcd(a-b, b,arr); + return gcd(a, b-a,arr); +} + +int main() +{ + int n; + int i; + cin>>n; + int arr[n]; + int count=0; +// for(i=0;i>arr[i]; +// } + int a,b; + for( i=0;i Date: Sun, 27 Feb 2022 17:58:35 +0530 Subject: [PATCH 3/3] Create Ritish04_gameofcodes_Ps-2 --- .../Solution/Ritish04_gameofcodes_Ps-2 | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Problem Statement-2/Solution/Ritish04_gameofcodes_Ps-2 diff --git a/Problem Statement-2/Solution/Ritish04_gameofcodes_Ps-2 b/Problem Statement-2/Solution/Ritish04_gameofcodes_Ps-2 new file mode 100644 index 0000000..459336d --- /dev/null +++ b/Problem Statement-2/Solution/Ritish04_gameofcodes_Ps-2 @@ -0,0 +1,43 @@ +// C++ program for the above approach +#include +using namespace std; + + +bool isPalindrome(string S) +{ + + for (int i = 0; i < n / 2; i++) { + + + + if (S[i] != S[n - i - 1]) { + + return false; + } + } + + return true; +} + + +int main() +{ + int n; + cin>>n; + string S; + cin>>S; + cout << isPalindrome(S); +int depth =0; +while(n%2!=0){ +if((n%2==0)&& (isPalindrome){ +n=n/2; +depth++; +string s1=s; +} + +} +return depth; +cout<