1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 07:21:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 15:21:05 +08:00
parent b84ae535b7
commit e730aa6794
2244 changed files with 8703 additions and 59499 deletions

View File

@@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 15096,
"likes": 15134,
"dislikes": 898,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Trapping Rain Water\", \"titleSlug\": \"trapping-rain-water\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"1.4M\", \"totalSubmission\": \"2.6M\", \"totalAcceptedRaw\": 1363033, \"totalSubmissionRaw\": 2551152, \"acRate\": \"53.4%\"}",
"stats": "{\"totalAccepted\": \"1.4M\", \"totalSubmission\": \"2.6M\", \"totalAcceptedRaw\": 1366153, \"totalSubmissionRaw\": 2557092, \"acRate\": \"53.4%\"}",
"hints": [
"The aim is to maximize the area formed between the vertical lines. The area of any container is calculated using the shorter line as length and the distance between the lines as the width of the rectangle.\r\n\r\n<pre>\r\nArea = length of shorter vertical line * distance between lines\r\n</pre>\r\n\r\nWe can definitely get the maximum width container as the outermost lines have the maximum distance between them. However, this container <b>might not be the maximum in size</b> as one of the vertical lines of this container could be really short.\r\n\r\n<br>\r\n<img src=\"https://assets.leetcode.com/uploads/2019/10/20/hint_water_trap_1.png\" width=\"500\"/>\r\n\r\n<br>\r\n<img src=\"https://assets.leetcode.com/uploads/2019/10/20/hint_water_trap_2.png\" width=\"500\"/>",
"Start with the maximum width container and go to a shorter width container if there is a vertical line longer than the current containers shorter line. This way we are compromising on the width but we are looking forward to a longer length container."