mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-24 18:55:36 +08:00
build
This commit is contained in:
@ -220,7 +220,7 @@ $$
|
||||
/* 最大容量:贪心 */
|
||||
func maxCapacity(ht: [Int]) -> Int {
|
||||
// 初始化 i, j,使其分列数组两端
|
||||
var i = 0, j = ht.count - 1
|
||||
var i = ht.startIndex, j = ht.endIndex - 1
|
||||
// 初始最大容量为 0
|
||||
var res = 0
|
||||
// 循环贪心选择,直至两板相遇
|
||||
|
Reference in New Issue
Block a user