最新 最热

Leetcode 7 Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321Easy,没什么好说的注意负数和溢出的情况class Solution {public: int reverse(...

2018-01-12
1

Leetcode 41 First Missing Positive 正解不是盛传的桶排序

Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm shou...

2018-01-12
1

Leetcode 59 Spiral Matrix II

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 following mat...

2018-01-12
1

Leetcode 51 N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens

2018-01-12
1

Leetcode 74 Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left ...

2018-01-12
1

Leetcode 95 Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should retur...

2018-01-12
1

Leetcode 88 Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is g...

2018-01-12
1

Leetcode 150 Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expressi...

2018-01-12
1

Leetcode 179 Largest Number

Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is...

2018-01-12
1

Leetcode 172 Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 求阶乘的后缀0个数 乘法中的零来源于10,10来源于2和5,......

2018-01-12
0