03 2016 档案
摘要:题目描述: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words
阅读全文
摘要:题目描述: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 3
阅读全文
摘要:题目描述: Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution se
阅读全文
摘要:题目描述: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: 解题思路:
阅读全文
摘要:题目描述: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its
阅读全文
摘要:题目描述: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your
阅读全文
摘要:题目描述: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at
阅读全文
摘要:题目描述: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2],
阅读全文
摘要:题目描述: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm
阅读全文
摘要:题目描述: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the
阅读全文
摘要:题目描述: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix:
阅读全文
摘要:题目描述: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4
阅读全文
摘要:题目描述: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following uni
阅读全文
摘要:题目描述: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Ea
阅读全文
摘要:题目描述: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same
阅读全文
摘要:题目描述: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set
阅读全文
摘要:内容来自《C++ Primer》第五版: 一个lambda表达式表示一个可调用的代码单元,可以将其理解成一个未命名的内联函数。与任何函数类似,一个lambda具有一个返回类型、一个参数列表和一个函数体。具体形式是: 1 // capture list(捕获列表)是一个lambda所在函数中定义的局部
阅读全文