摘要: Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A straight forward solution... 阅读全文
posted @ 2016-01-12 06:18 爱刷题的小盒子 阅读(214) 评论(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 space i... 阅读全文
posted @ 2015-05-30 04:12 爱刷题的小盒子 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo... 阅读全文
posted @ 2015-05-30 01:39 爱刷题的小盒子 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ... 阅读全文
posted @ 2015-05-30 01:26 爱刷题的小盒子 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 123Best Time to Buy and Sell Stock IIISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find ... 阅读全文
posted @ 2015-05-28 13:46 爱刷题的小盒子 阅读(604) 评论(0) 推荐(0) 编辑
摘要: leetCode 122 Best Time to Buy and Sell Stock IISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm... 阅读全文
posted @ 2015-05-27 10:42 爱刷题的小盒子 阅读(133) 评论(0) 推荐(0) 编辑
摘要: leetCode 121 Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permi... 阅读全文
posted @ 2015-05-27 09:30 爱刷题的小盒子 阅读(180) 评论(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 point ... 阅读全文
posted @ 2015-05-27 08:48 爱刷题的小盒子 阅读(146) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文
posted @ 2015-05-27 08:24 爱刷题的小盒子 阅读(142) 评论(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,1,... 阅读全文
posted @ 2015-05-27 08:14 爱刷题的小盒子 阅读(118) 评论(0) 推荐(0) 编辑