摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2017-10-16 10:52 daniel456 阅读(128) 评论(0) 推荐(0)
摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2017-10-16 10:45 daniel456 阅读(118) 评论(0) 推荐(0)
摘要: Given a collection of intervals, merge all overlapping intervals. For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. 题目:合并线段 阅读全文
posted @ 2017-10-16 10:39 daniel456 阅读(133) 评论(0) 推荐(0)
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2017-10-16 10:35 daniel456 阅读(135) 评论(0) 推荐(0)
摘要: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note:You have to rotate the image in-place, which 阅读全文
posted @ 2017-10-16 08:29 daniel456 阅读(187) 评论(0) 推荐(0)
摘要: Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexi 阅读全文
posted @ 2017-10-16 08:24 daniel456 阅读(141) 评论(0) 推荐(0)
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You a 阅读全文
posted @ 2017-10-16 07:58 daniel456 阅读(137) 评论(0) 推荐(0)
摘要: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. 阅读全文
posted @ 2017-10-16 07:56 daniel456 阅读(98) 评论(0) 推荐(0)
摘要: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of 阅读全文
posted @ 2017-10-16 07:54 daniel456 阅读(123) 评论(0) 推荐(0)
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-10-16 07:53 daniel456 阅读(125) 评论(0) 推荐(0)