Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19bc19b

Browse files
committed
11
1 parent8fb12cf commit19bc19b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmax_area(height)
2+
idx_start=0
3+
idx_end=height.length -1
4+
max_water=0
5+
whileidx_start <idx_end
6+
challenger=(height[idx_start] >height[idx_end] ?height[idx_end] :height[idx_start])
7+
challenger *=(idx_end -idx_start)
8+
max_water=challengerifchallenger >max_water
9+
10+
ifheight[idx_start] >height[idx_end]
11+
idx_end -=1
12+
else
13+
idx_start +=1
14+
end
15+
end
16+
max_water
17+
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp