From 2fd716c777b7b47f5d3cb13274771c839c16da48 Mon Sep 17 00:00:00 2001 From: Makrand R <35958423+makrandr1999@users.noreply.github.com> Date: Mon, 17 Sep 2018 17:54:46 +0530 Subject: [PATCH] Create Beautifularrays_makrand.c --- Beautifularrays_makrand.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Beautifularrays_makrand.c diff --git a/Beautifularrays_makrand.c b/Beautifularrays_makrand.c new file mode 100644 index 0000000..3fdadc7 --- /dev/null +++ b/Beautifularrays_makrand.c @@ -0,0 +1,39 @@ +#include + +int main(void) { + // your code goes here + int T=0; + scanf("%d",&T); + while(T--){ + int n=0,ones=0,zeroes=0,minus_ones=0,other=0; + scanf("%d",&n); + int arr[n]; + for(int i=0;i1) + printf("no\n"); + else if(other==1) + { + if(minus_ones!=0) + printf("no\n"); + else + printf("yes\n"); + } + else + { + if(other==0&&minus_ones>1&&ones==0) + printf("no\n"); + else + printf("yes\n"); + } + + } + + return 0; +}