Neat Solution in C++


#1
int Solution::solve(int A, int B, int C, int D) {
    if (((A==B)&&(C==D))||((A==C)&&(B==D))||((A==D)&&(B==C))){
        return 1;
    }else{
        return 0;
    }
}

#2

make it even cleaner! remove the if-else, and just return the expression inside of the if statement.


#3

what if A,B,C,D all are equal it become square and your answer return 1 there


#4

Squares are also rectangle lol