Neat Solution in C++

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;
        return 0;


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


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


Squares are also rectangle lol