摘要: class Solution { public: map dict; vector letterCombinations(string digits) { dict['2'] = "abc"; dict['3'] = "def"; dict['4'] = "ghi"; dict['5'] = "jk... 阅读全文
posted @ 2019-03-28 18:04 newbird2017 阅读(105) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/3sum/ 套路比较常见了,最重要的是去重。还是没法一次通过。 阅读全文
posted @ 2019-03-28 15:32 newbird2017 阅读(180) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/container-with-most-water/ 给出一堆数,是一个一维向量上的高。求出左右两个数作为高度,最大的装水的面积。 第一种,最笨的办法,就是 轮询,o(n^2)的搜索。 一个指针指向左侧,一个指向右侧,通过枚举出所有的组合, 阅读全文
posted @ 2019-03-28 10:55 newbird2017 阅读(108) 评论(0) 推荐(0) 编辑