摘要: 前言这题非要说贪心的话也算是吧,不过最主要的特征还是双指针。LC的题好像不少都是扔倆头尾指针然后遍历一遍完事儿的。这道题倒是“短板效应”的不错体现了。题目题目链接Given n non-negative integers a1, a2, …, an, where each represents a ... 阅读全文
posted @ 2015-12-04 16:42 AllZY 阅读(526) 评论(0) 推荐(0) 编辑
摘要: 刷LeetCode的第一题,TwoSum,基本算是水过。题目:https://leetcode.com/problems/two-sum/Given an array of integers, find two numbers such that they add up to a specific ... 阅读全文
posted @ 2015-12-04 10:29 AllZY 阅读(184) 评论(0) 推荐(0) 编辑