摘要: 题目描述 leetcode - 994:https://leetcode-cn.com/problems/container-with-most-water/ 解题关键 宽搜 碎碎念 这题除了用 宽搜 以外,还用了 结构体 来存数据,因为需要记录搜索中的层数。宽搜得到的树的 高度 其实就是答案。 用 阅读全文
posted @ 2020-06-02 17:41 _Sleeping 阅读(180) 评论(0) 推荐(0)
摘要: 题目描述 leetcode - 11:https://leetcode-cn.com/problems/container-with-most-water/ 解题关键 双指针法 求出当前双指针对应的容器的容量 对应数字较小的那个指针以后不可能作为容器的边界了,将其丢弃,并移动对应的指针。 碎碎念 双 阅读全文
posted @ 2020-06-02 02:01 _Sleeping 阅读(117) 评论(0) 推荐(0)