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
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)
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
why are we doing sorting here?
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)