随笔分类 -  Leetcode

上一页 1 ··· 5 6 7 8 9
摘要:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2014-11-14 10:53 Jessica程序猿 阅读(285) 评论(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 @ 2014-11-14 09:12 Jessica程序猿 阅读(139) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-11-14 09:09 Jessica程序猿 阅读(178) 评论(0) 推荐(0)
摘要: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 equal... 阅读全文
posted @ 2014-11-14 09:06 Jessica程序猿 阅读(190) 评论(0) 推荐(0)
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2014-11-13 21:36 Jessica程序猿 阅读(164) 评论(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,1]... 阅读全文
posted @ 2014-11-13 18:36 Jessica程序猿 阅读(235) 评论(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 onlyO(... 阅读全文
posted @ 2014-11-13 17:29 Jessica程序猿 阅读(160) 评论(0) 推荐(0)
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2014-11-13 16:35 Jessica程序猿 阅读(163) 评论(0) 推荐(0)
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2014-11-13 15:53 Jessica程序猿 阅读(269) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9