diff options
author | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
commit | a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch) | |
tree | e2a2b3f49f9fb741be81415266ac93e74cff42ec /other/max_area_cake.cpp | |
parent | 694ad5ed71edcb1deccab54b72d706b779918276 (diff) | |
download | leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip |
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/max_area_cake.cpp')
-rw-r--r-- | other/max_area_cake.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/other/max_area_cake.cpp b/other/max_area_cake.cpp deleted file mode 100644 index da1f745..0000000 --- a/other/max_area_cake.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int maxArea(int h, int w, vector<int> &horizontalCuts, - vector<int> &verticalCuts) { - sort(horizontalCuts.begin(), horizontalCuts.end()); - sort(verticalCuts.begin(), verticalCuts.end()); - int maxH = max(horizontalCuts[0], h - horizontalCuts.back()); - int maxV = max(verticalCuts[0], w - verticalCuts.back()); - for (int i = 1; i < horizontalCuts.size(); i++) - maxH = max(maxH, horizontalCuts[i] - horizontalCuts[i - 1]); - for (int i = 1; i < verticalCuts.size(); i++) - maxV = max(maxV, verticalCuts[i] - verticalCuts[i - 1]); - return ((long)maxH * maxV % 1000000007); - } -}; - -int main() { - Solution obj; - int h = 5, w = 4; - vector<int> horizontalCuts = {1, 2, 4}; - vector<int> verticalCuts = {1, 3}; - cout << obj.maxArea(h, w, horizontalCuts, verticalCuts); -} |