Clarification of one point taught

As it was said that p1 and p2 can be paired up twice i.e. why ans/2 was done …but p3 and p4 the other diagonal could have come once as a case then this rectangle would have been considered so ans/2 was done.
As pairs are sorted in set so p1 and p2 cannot be repeated as a pair (the way we are iterating) .
Am I right…?

hi @himanshuanand729 even sorted here you will get the count twice, coz u r looking for diagonally opposite points as bhaiya explained at 6:00