### leetcode解析

leetcode是一个程序员成长过程中需要经历的最好的刷题网站之一。 本人通过亲身实践，对leetcode中的大部分题进行解答和总结，希望能对 看到专栏的人有所帮助。

0 已关注
45篇博文
• #### leetcode——Lowest Common Ancestor of a Binary Search Tree

题目Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the ...

2015-08-11 20:24
513
• #### leetcode——Lowest Common Ancestor of a Binary Tree

题目Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.思路这一次说的是...

2015-08-11 21:04
537
• #### leetcode——Product of Array Except Self

题目Given an array of n integers where n > 1, nums, return an array output such that output[i] is equa...

2015-08-12 10:59
568
• #### leetcode——Sliding Window Maximum

题目Given an array nums, there is a sliding window of size k which is moving from the very left of the...

2015-08-12 10:59
531
• #### leetcode——Count Primes

题目 Description: Count the number of prime numbers less than a non-negative number, n. 方法 对于这道题，最...

2015-08-04 15:24
442
• #### leetcode——Count Complete Tree Nodes

题目Count Complete Tree Nodes Given a complete binary tree, count the number of nodes.In a complete b...

2015-08-04 16:11
523
• #### leetcode——Rotate Image

题目： You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (...

2014-12-13 21:23
506
• #### leetcode——Edit Distance

题目： Given two words word1 and word2, find the minimum number of steps required to convert word1 to ...

2014-12-20 21:00
452
• #### leetcode——Palindrome Partitioning II

题目： Given a string s, partition s such that every substring of the partition is a palindrome. ...

2014-12-28 16:52
502
• #### leetcode——Largest Number

题目： Given a list of non negative integers, arrange them such that they form the largest number. ...

2015-01-19 16:48
551
• #### leetcode——Factorial Trailing Zeroes

题目： Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be...

2015-01-20 10:15
1179
• #### leetcode——Dungeon Game

题目： The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a...

2015-01-20 11:14
822
• #### leetcode——Distinct Subsequences

题目： Given a string S and a string T, count the number of distinct subsequences of T in S. A subse...

2015-01-31 21:15
495
• #### leetcode——Valid Sudoku

题目： Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku boa...

2015-02-01 21:48
542
• #### leetcode——Next Permutation

题目： Implement next permutation, which rearranges numbers into the lexicographically next greate...

2015-02-04 13:26
622
• #### leetcode——Gas Station

题目： There are N gas stations along a circular route, where the amount of gas at station i is gas[i...

2015-02-04 13:36
669
• #### leetcode——First Missing Positive

题目： Given an unsorted integer array, find the first missing positive integer. For example, ...

2015-02-04 16:07
589
• #### leetcode——Jump Game

题目： Given an array of non-negative integers, you are initially positioned at the first index of th...

2014-12-01 13:19
443
• #### leetcode——Spiral Matrix

题目： Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in ...

2014-12-01 14:44
425
• #### leetcode——ZigZag Conversion

题目： The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this...

2014-12-02 14:35
447