
LeetCode
文章平均质量分 81
silence_cj
这个作者很懒,什么都没留下…
展开
-
LeetCode: 1. Two Sum
1. 题目Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the sa...原创 2018-05-10 18:17:17 · 112 阅读 · 0 评论 -
剑指offer:连续子数组的最大和
1. 题目描述 该题在leetcode和剑指offer中都有,题目描述为:HZ偶尔会拿些专业问题来忽悠那些非计算机专业的同学。今天测试组开完会后,他又发话了:在古老的一维模式识别中,常常需要计算连续子向量的最大和,当向量全为正数的时候,问题很好解决。但是,如果向量中包含负数,是否应该包含某个负数,并期望旁边的正数会弥补它呢?例如:{6,-3,-2,7,-15,1,2,2},连续子向量的最大和...原创 2018-05-11 11:26:54 · 128 阅读 · 0 评论