摘要: Problem Description:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1... 阅读全文
posted @ 2014-06-29 15:04 HaruHaru 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your alg... 阅读全文
posted @ 2014-06-29 15:03 HaruHaru 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Problem Description: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 ex... 阅读全文
posted @ 2014-06-29 15:02 HaruHaru 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most... 阅读全文
posted @ 2014-06-29 15:01 HaruHaru 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit... 阅读全文
posted @ 2014-06-29 15:00 HaruHaru 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit... 阅读全文
posted @ 2014-06-29 14:58 HaruHaru 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below bina... 阅读全文
posted @ 2014-06-29 14:56 HaruHaru 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a... 阅读全文
posted @ 2014-06-29 14:55 HaruHaru 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Onl... 阅读全文
posted @ 2014-06-29 14:54 HaruHaru 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one l... 阅读全文
posted @ 2014-06-29 14:52 HaruHaru 阅读(161) 评论(0) 推荐(0) 编辑