2015年1月26日

摘要: 题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two... 阅读全文
posted @ 2015-01-26 17:55 承续缘 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty spac... 阅读全文
posted @ 2015-01-26 16:12 承续缘 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any poi... 阅读全文
posted @ 2015-01-26 14:59 承续缘 阅读(713) 评论(0) 推荐(0) 编辑

2015年1月24日

摘要: 题目:Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?... 阅读全文
posted @ 2015-01-24 20:05 承续缘 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,... 阅读全文
posted @ 2015-01-24 18:55 承续缘 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in... 阅读全文
posted @ 2015-01-24 12:24 承续缘 阅读(211) 评论(0) 推荐(0) 编辑

2015年1月22日

摘要: 题目:A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its ind... 阅读全文
posted @ 2015-01-22 23:10 承续缘 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the ... 阅读全文
posted @ 2015-01-22 14:41 承续缘 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2... 阅读全文
posted @ 2015-01-22 00:12 承续缘 阅读(1333) 评论(1) 推荐(1) 编辑

2015年1月21日

摘要: 题目:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or eq... 阅读全文
posted @ 2015-01-21 22:04 承续缘 阅读(834) 评论(0) 推荐(0) 编辑

导航