diff --git a/C++/maximize-area-of-square-hole-in-grid.cpp b/C++/maximize-area-of-square-hole-in-grid.cpp new file mode 100644 index 0000000..fccbfb1 --- /dev/null +++ b/C++/maximize-area-of-square-hole-in-grid.cpp @@ -0,0 +1,32 @@ +class Solution { +public: + int maximizeSquareHoleArea(int n, int m, vector& hBars, vector& vBars) { + int h = hBars.size(); + int v = vBars.size(); + + sort(hBars.begin(),hBars.end()); + sort(vBars.begin(),vBars.end()); + + int mxh = 1, mxv = 1,curr = 1; + + for(int i=1; i