摘要: 题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the ... 阅读全文
posted @ 2015-07-03 15:58 Hygeia 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onl... 阅读全文
posted @ 2015-07-03 14:18 Hygeia 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4... 阅读全文
posted @ 2015-07-03 11:19 Hygeia 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目:Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is gr... 阅读全文
posted @ 2015-07-01 15:45 Hygeia 阅读(104) 评论(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... 阅读全文
posted @ 2015-07-01 12:36 Hygeia 阅读(143) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2015-07-01 09:53 Hygeia 阅读(1) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2015-06-10 10:55 Hygeia 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of integers. Find a peak element in it. An array element is peak if it is NOT smaller than its neighbors. For corner elements, we ne... 阅读全文
posted @ 2015-06-06 07:05 Hygeia 阅读(270) 评论(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 en... 阅读全文
posted @ 2015-06-06 06:43 Hygeia 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not poss... 阅读全文
posted @ 2015-06-06 06:21 Hygeia 阅读(187) 评论(1) 推荐(0) 编辑