自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 leetcode House Robber

题目:198. House RobberYou 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

2017-10-29 21:34:01 161

原创 leetcode 686. Repeated String Match

题目:Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1.For example, with A = "abcd" and B = "cda

2017-10-29 11:27:19 351

原创 leetcode 55. Jump Game

题目: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 maximum jump length at that position.De

2017-10-25 22:21:42 125

原创 leetcode 456. 132 Pattern

题目:Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i j k and ai < ak j. Design an algorithm that takes a list of n numbers as input

2017-10-25 12:00:07 147

原创 leetcode 230. Kth Smallest Element in a BST

题目:Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.void f(vector &r

2017-10-24 16:43:38 150

原创 leetcode 435. Non-overlapping Intervals

题目:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may assume the interval's end poi

2017-10-24 10:37:05 160

原创 leetcode 204. Count Primes

题目:Description:Count the number of prime numbers less than a non-negative number, n.思路:暴力求解是一种,还有就是筛选法,创建一个n的数组,初始化为true,遍历开始,就是当i是质(素)数的时候,i的所有的倍数必然是合数。如果i已经被判断不是质数了,那么再找到i后面的质数来把这个质数的倍

2017-10-23 18:42:55 112

原创 leetcode 453. Minimum Moves to Equal Array Elements

题目:Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1.Example:Input:[1

2017-10-23 18:21:20 110

原创 Leetcode 330. Patching Array

题目:Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the

2017-10-21 12:00:44 115

原创 Leetcode 513. Find Bottom Left Tree Value

题目:Given a binary tree, find the leftmost value in the last row of the tree.void f(TreeNode* root,int cur,vector>& re){ if(root !=NULL){ if(cur < re.size()){ re[cur].push

2017-10-20 16:04:55 110

原创 leetcode 451. Sort Characters By Frequency

题目:Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Explanation:'e' appears twice while 'r' and 't' both appear on

2017-10-19 12:03:12 122

转载 leetcode 139. Word Break

题目: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.For example, givens = "leetcode",dict 

2017-10-19 12:02:08 109

原创 leetcode 279. Perfect Squares

题目:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4;

2017-10-17 22:34:59 103

翻译 Leetcode 390. Elimination Game

raw blog:http://blog.csdn.net/corpsepiges/article/details/52573281 题目:There is a list of sorted integers from 1 to n. Starting from left to right, remove the first number and every other numbe

2017-10-10 16:56:49 231

空空如也

空空如也

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

TA关注的人

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