【leetcode】盛水最多的容器【C++】

題目如下: 解題思路: 1、最簡單的思路就是暴力求解,採用兩次循環,時間複雜度爲O(n^2)。 代碼如下: class Solution { public: int maxArea(vector<int>& height) { int length = height.size(); int max = 0; int temp = 0;
相關文章
相關標籤/搜索