Comments
Spoiler

Please Anyone help me in my code for C problem i got stucked getting wrong answers

For 2094C — Brr Brrr Patapim ----- More optimised Code than the editorial one

void solve(){
    int n;
    cin>>n;
    vector<vector<int>>mat(n,vector<int>(n));
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>mat[i][j];
        }
    }

    // main
    
    vector<int>ans(2*n);
    int actualSum=2*n*(2*n+1)/2;
    int sum=0,k=1;

    for(int j=0;j<n;j++){
        ans[k++]=mat[0][j];
        sum += mat[0][j];
    } 
    for(int i=1;i<n;i++){
        ans[k++]=mat[i][n-1];
        sum += mat[i][n-1];
    }
    ans[0] = actualSum - sum;

    for(int i=0;i<2*n;i++) cout<<ans[i]<<" ";
    cout<<"\n";
}

Using the logic of missing number to find the p1

div 3 C Prefix min and suffix max

#include<iostream> 
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdlib.h>
#include<climits>

using ll=long long;

using namespace std;

void solve();

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T=1;
    cin>>T;

    while(T--) solve();
    return 0;
}

void solve(){
    int n;
    cin>>n;
    vector<int>arr(n);
    for(int i=0;i<n;i++) cin>>arr[i];
    // main

    int mn=INT_MAX,mx=INT_MIN;
    for(auto x:arr){
        if(mn > x) mn=x;
        if(mx < x) mx=x;
    }

    string bs="";
    for(int i=0;i<n;i++){
        if(i==0 || i==n-1) bs += '1';
        else if(arr[i]==mx || arr[i]==mn) bs += '1';
        else bs += '0';
    }
    cout<<bs<<endl;
}

Why my code is Wrong

Thanks bro

void printCheckSquare(int l,int b){
    if(l == b) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

void solve(){
    int l1,b1,l2,b2,l3,b3;
    cin>>l1>>b1>>l2>>b2>>l3>>b3;

    // main code
    if((l1==l2 && l2==l3)) printCheckSquare(l1,b1+b2+b3);
    else if(b1==b2 && b2==b3) printCheckSquare(b1,l1+l2+l3);
    else if(b1 == b2+b3 && l2==l3) printCheckSquare(b1,l1+l2);
    else if(l1==l2+l3 && (b2==b3)) printCheckSquare(l1,b1+b2);

    else cout<<"NO"<<endl;
}

WHY NOT WORKING PLEASE HELP???