摘要: 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 f... 阅读全文
posted @ 2015-08-14 05:11 米丹 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 题目Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums excep... 阅读全文
posted @ 2015-08-09 01:38 米丹 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2015-08-09 01:01 米丹 阅读(126) 评论(0) 推荐(0) 编辑
摘要: There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. T... 阅读全文
posted @ 2015-08-07 07:45 米丹 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2015-08-05 04:20 米丹 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Thelongest common subsequence(LCS)problemis the problem of finding the longestsubsequencecommon to all sequences in a set of sequences (often just two... 阅读全文
posted @ 2015-07-30 05:08 米丹 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Given an integer matrix, find a submatrix where the sum of numbers is zero. Your code should return the coordinate of the left-up and right-down numbe... 阅读全文
posted @ 2015-07-28 02:37 米丹 阅读(300) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list.Thoughts:1.Iterative Method.Loop the linked list, set two pointers, one called"first" to always point to the head of the ... 阅读全文
posted @ 2015-07-18 02:27 米丹 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Question:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the st... 阅读全文
posted @ 2015-07-17 05:23 米丹 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Question:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume tha... 阅读全文
posted @ 2015-07-14 05:41 米丹 阅读(190) 评论(0) 推荐(0) 编辑