自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 377. Combination Sum IV

题目Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.Example:nums = [1, 2, 3]target = 4The possible c

2017-11-25 20:45:47 252

原创 474. Ones and Zeroes

题目In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.For now, suppose you are a dominator of m 0s and n 1s respectively. On the other h

2017-11-25 20:36:34 168

原创 64. Minimum Path Sum

题目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 path.Note: You can only move either down or right at an

2017-11-25 20:31:06 125

原创 300. Longest Increasing Subsequence

题目Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101], therefo

2017-11-25 20:21:37 150

原创 91. Decode Ways

题目A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number of

2017-11-25 20:05:07 140

原创 303. Range Sum Query - Immutable

题目Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1sumRange(0, 5)

2017-11-25 20:01:08 142

原创 198. House Robber

题目You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent hous

2017-11-25 19:55:40 137

原创 718. Maximum Length of Repeated Subarray

题目Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.Example 1:Input:A: [1,2,3,2,1]B: [3,2,1,4,7]Output: 3Explanation: The repeated subarray wit

2017-11-25 19:47:14 181

原创 70. Climbing Stairs

题目You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive in

2017-11-18 22:19:37 164

原创 96. Unique Binary Search Trees

题目Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, Given n = 3, there are a total of 5 unique BST’s. 1 3 3 2 1 \ /

2017-11-18 21:09:40 136

原创 62. Unique Paths

题目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 any point in time. The robot is trying to reach the bot

2017-11-17 22:21:56 192

原创 121. Best Time to Buy and Sell Stock

题目题意找到 max(nums[j] - nums[i]) , j > i && nums[j] > nums[i]max(nums[j] - nums[i]) , j&nbs

2017-11-16 23:54:14 136

原创 312. Burst Balloons

题目题意炸掉i处的气球能获得nums[i−1]∗nums[i]∗nums[i+1]nums[i-1]*nums[i]*nums[i+1], 用过的气球就没有了, 可以将最左端和最右端看作有一个额外的1, 求总收益的最大值分析参考了这里有例子分析依次遍历不同长度len的子串s[left, right] (left∈[0, n -len], right = left+len-1);用k∈[left,

2017-11-16 21:27:22 132

原创 516. Longest Palindromic Subsequence

题目题意求数组的回文子序列的最长长度分析用f[i][j]f[i][j]表示从i到j的回文子序列的最长长度 转移方程如下 如果s[i]==s[j]s[i] == s[j], f[i][j]=f[i+1][j−1]+2f[i][j] = f[i+1][j-1] +2 如果s[i]!=s[j]s[i] != s[j], f[i][j]=max(f[i][j−1],f[i+1][j])f[i][j]

2017-11-16 20:43:27 170

原创 494. Target Sum

题目You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.Find out how many

2017-11-16 11:55:54 222

原创 392. Is Subsequence

子序列

2017-11-16 10:22:45 152

原创 486. Predict the Winner

Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each tim

2017-11-08 14:14:52 149

原创 357. Count Numbers with Unique Digits

题目Given a non-negative integer n, count all numbers with unique digits, x, where 0≤x<10n0 ≤ x < 10^n.Example: Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 10

2017-11-08 11:13:37 131

原创 343. Integer Break

题目Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, return

2017-11-08 10:34:53 115

原创 646. Maximum Length of Pair Chain

You are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now, we define a pair (c, d) can follow another pair (a, b) if and only

2017-11-08 10:13:43 153

原创 712. Minimum ASCII Delete Sum for Two Strings

Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.Example 1:Input: s1 = "sea", s2 = "eat"Output: 231Explanation: Deleting "s"

2017-11-08 09:43:20 361

原创 413. Arithmetic Slices

A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For example, thes

2017-11-07 17:11:27 127

原创 647. Palindromic Substrings

Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substr

2017-11-03 13:05:51 134

原创 338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Examp

2017-11-03 12:13:14 283

原创 210. Course Schedule II

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which

2017-11-02 22:08:02 147

原创 207. Course Schedule

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which

2017-11-02 21:01:40 147

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除