I am not getting how we are approaching the problem like what we are doing, we are generating alll possible combinations of p1 and p2 with p1 != p2.
but for ans = ans/2, one more case needs to be there but there are actually two case like p1 can be equal to p3 or p1 can be equal to p4 while p2 = p4 for one and p2=p3 for other. please elaborate this approach, I am facing problem in this
Why ans = ans/2
hello @great
becuase our point are already in sorted order becuase of set.
so we will only get point (A and then point C) or point( D and then point B) ie points in increasing order
the other two cases will not occur ie (C and then A) or (B and then D) becuase they are in decreasing order
that is the reson why we are doing ans/2 becuase all rectangle are counted twice
Thanks a lot for your reply. I completely understood it now, just one query why one empty constructor is defined in Class Point implementation.
…
that is a default constructor, at the time of creating object if we dont pass any value then this construtor will be called
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.