please tell why my code is not pasiing one of the test cases
Why my code is not passing one of the test cases
Hey @harryson
int c1 = (x2 <= x3);//x2<=x3
int c2 = (x1 >= x4);
int c3 = (y3 >= y2);
int c4 = (y1 >= y4); //y1>=y4
ISo the conditions that the two rectangles will not overlap will be as follows:-
If rec1 left of rec2:
rec1[2] <= rec2[0], i.e rightmost x coordinate of rec1 is smaller than or equal to the leftmost x coordinate of rec2.
Or
If rec1 is right of rec2:
rec1[0] >= rec2[2], i.e leftmost x coordinate of rec1 is greater than or equal to the rightmost x coordinate of rec2.
Or
If rec1 is above of rec2:
rec1[1] >= rec2[3], i.e leftmost y coordinate of rec1 is greater than or equal to rightmost y coordinate of rec2.
Or
If rec1 is below of rec2:
rec1[3] <= rec2[1], i.e rightmost y coordinate of rec1 is lesser than or equal to leftmost y coordinate of rec2.
If this resolves your query then please mark it as resolved 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.