Solution code - class Solution { public: int minAreaRect(vector& points) { sort(points.begin(),points.end()); int ans = INT_MAX; int n = points.size(); set set; for (int i=0;i
@gagandeepsingh15334 ай бұрын
why are we doing sorting here?
@CodingWithAnurag-10864 ай бұрын
Thanks for pointing it out. Sorting is actually not required. I had done sorting so that solution visualisation becomes easy and even if we add sorting, it doesn't impact the overall time complexity. The overall time complexity is still O(n*n*logn)