Skip to content

Commit 580542e

Browse files
docs
1 parent f8e0d47 commit 580542e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

explanations/11/en.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://leetcode.com/problems/container-with-most-water/
44

55
## Description
6+
67
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the i-th line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water.
78

89
Return the maximum amount of water a container can store.
@@ -32,10 +33,8 @@ Constraints:
3233

3334
> **Hint:** Use two pointers, one at each end, and move the pointer with the shorter line inward.
3435
35-
### Explanation
36-
3736
## Explanation
38-
Imagine the array as a row of sticks of different heights. You want to pick two sticks that, together with the x-axis, can hold the most water. The area is determined by the shorter stick and the distance between them. Start with the two ends and move the pointer pointing to the shorter stick inward, always looking for a bigger area.
3937

40-
This approach is efficient because it checks all possible pairs in linear time, always keeping the best answer found so far.
38+
Imagine the array as a row of sticks of different heights. You want to pick two sticks that, together with the x-axis, can hold the most water. The area is determined by the shorter stick and the distance between them. Start with the two ends and move the pointer pointing to the shorter stick inward, always looking for a bigger area.
4139

40+
This approach is efficient because it checks all possible pairs in linear time, always keeping the best answer found so far.

explanations/3745/en.md

Whitespace-only changes.

0 commit comments

Comments
 (0)