displaying the desired output in other platforms but not displaying in leetcode compiler
Anonymous User
40

https://leetcode.com/explore/challenge/card/august-leetcoding-challenge-2021/613/week-1-august-1st-august-7th/3835/
this is the question
ans
#include<stdio.h>
int main(){
int a,sum=0,k=0;
int arr[2][2];
for (int i=0;i<2;i++){
for(int j=0;j<2;j++){
scanf("%d",&a);
if(a==1||a==0){
arr[i][j]=a;
}
}
}

for (int i=0;i<2;i++){
    for(int j=0;j<2;j++){
        if(arr[i][j]==1){
            sum=sum+1;
        }
        else{
            k=1;
        }
    }
}
printf("%d",sum+k);

return 0;

}

Comments (0)