From 2176db62f7f2f9bbd2b723755bd369d8dfa318eb Mon Sep 17 00:00:00 2001 From: "[ayushkrtiwari]" Date: Fri, 5 Apr 2024 18:28:20 +0530 Subject: [PATCH 1/2] build: solution update --- hard/day_12/solution.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/hard/day_12/solution.cpp b/hard/day_12/solution.cpp index 8d3ad8d..328bf13 100644 --- a/hard/day_12/solution.cpp +++ b/hard/day_12/solution.cpp @@ -1 +1,32 @@ -//write your code here \ No newline at end of file +#include +using namespace std; + +int main() +{ + int t; + cin >> t; + while(t--) + { + int n; + cin >> n; + int arr[n]; + for(int i=0; i> arr[i]; + if(i % 2 == 0) + { + arr[i] = (arr[i] % 2 == 0) ? arr[i] : arr[i] + 1; + } + else + { + arr[i] = (arr[i] % 2 != 0) ? arr[i] : arr[i] + 1; + } + } + + for(int i=0; i Date: Fri, 5 Apr 2024 23:10:16 +0530 Subject: [PATCH 2/2] build: solution update2 --- hard/day_12/solution.cpp | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/hard/day_12/solution.cpp b/hard/day_12/solution.cpp index 328bf13..8d3ad8d 100644 --- a/hard/day_12/solution.cpp +++ b/hard/day_12/solution.cpp @@ -1,32 +1 @@ -#include -using namespace std; - -int main() -{ - int t; - cin >> t; - while(t--) - { - int n; - cin >> n; - int arr[n]; - for(int i=0; i> arr[i]; - if(i % 2 == 0) - { - arr[i] = (arr[i] % 2 == 0) ? arr[i] : arr[i] + 1; - } - else - { - arr[i] = (arr[i] % 2 != 0) ? arr[i] : arr[i] + 1; - } - } - - for(int i=0; i