摘要:
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... 阅读全文
摘要:
题目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... 阅读全文
摘要:
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
摘要:
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... 阅读全文
摘要:
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,... 阅读全文
摘要:
Thelongest common subsequence(LCS)problemis the problem of finding the longestsubsequencecommon to all sequences in a set of sequences (often just two... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文