- 博客(13)
- 资源 (2)
- 收藏
- 关注
原创 leetcode刷题系列C++-single number II
Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usi
2016-02-22 17:29:13 532
原创 leetcode刷题系列C++-single number I
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ext
2016-02-22 16:42:40 466
原创 leetcode刷题系列C++-candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on
2016-02-22 16:23:27 1021
原创 leetcode刷题系列C++-Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to
2016-02-22 15:30:00 517
原创 leetcode刷题系列C++-rotate image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?Subscribe to see which companies asked this que
2016-02-22 11:18:26 543
原创 leetcode刷题系列C++-valid sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A partially fille
2016-02-21 18:05:41 402
原创 leetcode刷题系列C++-next permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible
2016-02-19 18:00:58 265
原创 leetcode刷题系列C++-remove element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.
2016-02-19 16:57:56 251
原创 leetcode刷题系列C++-3sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c
2016-02-19 16:25:33 391
原创 leetcode刷题系列C++-4sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Element
2016-02-19 15:43:56 266
原创 leetcode刷题系列C++-3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2016-02-19 15:17:43 382
原创 leetcode刷题系列C++-Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1, 2, 3
2016-02-17 14:12:16 678
原创 leetcode刷题系列C++-Search in Rotated Sorted Array II
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Subscribe to see whic
2016-02-01 14:54:13 296
web.py-0.33
2014-06-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人