摘要: 题目: LeetCode: [18. 4Sum][1] 描述: 分析: 代码: 备注: 感觉方法不是特别好,后续可能在投入时间在思考,LC Discuss上应该有更高效的方法。欢迎大家指正。 tip: 1、[15. 3Sum][2]以及[16. 3Sum Closest][3]; 2、[unorde 阅读全文
posted @ 2017-06-30 18:30 suilin 阅读(147) 评论(0) 推荐(1) 编辑
摘要: 题目: LeetCode: [17. Letter Combinations of a Phone Number][1] 描述: 分析: 代码: 备注: 可以参考 cinderella_niu的博客[LeetCode: 87 Letter Combinations of a Phone Number 阅读全文
posted @ 2017-06-29 19:41 suilin 阅读(158) 评论(0) 推荐(1) 编辑
摘要: 题目: LeetCode: [16. 3Sum Closest][1] 描述: 分析: 本题思路和[15. 3Sum][2]基本上一致的。 代码: 备注: 可以参考[15. 3Sum][2]. [1]: https://leetcode.com/problems/3sum closest/ /des 阅读全文
posted @ 2017-06-29 19:10 suilin 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 题目: LeetCode: [15. 3Sum][1] 描述: 分析: 代码: c++ vector threeSum(vector& vecNum) { vector vecRes; if (vecNum.size() ::iterator iterBg = vecNum.begin(); ite 阅读全文
posted @ 2017-06-28 21:45 suilin 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目: LeetCode: [14. Longest Common Prefix][1] 描述: 分析: 代码: c++ / @brief: @param[in]: strs,The string to be processed return: the common string / string 阅读全文
posted @ 2017-06-27 18:30 suilin 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目: LeetCode: [13. Roman to Integer][1] 描述: 题意为 给定一个罗马数字转换为整数(1 3999)输出。 分析: 代码: c++ int romanToInt(string s) { int nRes = 0; int nLen = s.length(); f 阅读全文
posted @ 2017-06-21 18:28 suilin 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题目: LeetCode: [12. Integer to Roman][1] 描述: 题意为 给定一个整数(1 3999)转换为罗马数字输出。 分析: 暴力方式 进制思路 代码: 思路一:暴力方式 思路二:进制思路 备注: 1. [罗马数字的百科介绍][2] 2. [罗马数字“ 0”的存在][3] 阅读全文
posted @ 2017-06-14 19:55 suilin 阅读(369) 评论(0) 推荐(1) 编辑
摘要: 题目: LeetCode: [11. Container With Most Water][1] 描述: 1. 从已有的数组中,选找两个线段使得他能构成最大的盛水容器。 2. 盛水容器,根据生活常识,容量取决于最短的那条边; 3. 盛水容量为: S = a(长) b(宽) = min(i , j) 阅读全文
posted @ 2017-06-14 19:39 suilin 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目: LeetCode: [10. Regular Expression Matching][1] 描述: Implement regular expression matching with support for '.' and ' '. 大体意思和正则匹配很相似,但不同的是 是匹配前一个字符 阅读全文
posted @ 2017-05-26 00:20 suilin 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目: Leetcode: [ 9. Palindrome Number ][1] 描述: 内容:Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative 阅读全文
posted @ 2017-05-17 00:00 suilin 阅读(165) 评论(0) 推荐(0) 编辑