### leetcode

leetcode各个题目的思路解法和大神解法的介绍

6 已关注
257篇博文
• #### leetcode 85. Maximal Rectangle(最大全1子矩阵)

Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and...

2017-12-11 13:07
72
• #### leetcode 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) ...

2017-12-18 19:37
80
• #### leetcode 91. Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' ...

2017-12-30 21:35
47
• #### leetcode 124. Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence ...

2018-01-01 22:59
47
• #### Weekly Contest 70 leetcode 779. K-th Symbol in Grammar

On the first row, we write a 0. Now in every subsequent row, we look at the previous row and repla...

2018-02-04 18:40
271
• #### Weekly Contest 70 leetcode 777. Swap Adjacent in LR String

In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of eithe...

2018-02-04 22:36
89
• #### Weekly Contest 70 leetcode 778. Swim in Rising Water

On an N x N grid, each square grid[i][j] represents the elevation(高度) at that point (i,j).Now rain s...

2018-02-09 23:16
82
• #### leetcode 54. Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral or...

2018-02-10 23:31
35
• #### Weekly Contest 71 leetcode 783. Minimum Distance Between BST Nodes

Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the...

2018-02-11 14:11
47
• #### Weekly Contest 71 leetcode 781. Rabbits in Forest

In a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how ...

2018-02-11 14:46
213
• #### Weekly Contest 71 leetcode 780. Reaching Points

A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given...

2018-02-11 15:12
130
• #### Weekly Contest 71 leetcode 782. Transform to Chessboard

An N x N board contains only 0s and 1s. In each move, you can swap any 2 rows with each other, or a...

2018-02-11 15:46
154
• #### Weekly Contest 72 leetcode 784. Letter Case Permutation

Given a string S, we can transform every letter individually to be lowercase or uppercase to create ...

2018-02-18 13:45
101
• #### Weekly Contest 72 leetcode 785. Is Graph Bipartite?

Given a graph, return true if and only if it is bipartite. Recall that a graph is bipartite if ...

2018-02-18 14:22
185
• #### Weekly Contest 72 leetcode 787. Cheapest Flights Within K Stops

There are n cities connected by m flights. Each fight starts from city u and arrives at v with a p...

2018-02-18 16:58
153
• #### Weekly Contest 72 leetcode 786. K-th Smallest Prime Fraction

A sorted list A contains 1, plus some number of primes.  Then, for every p < q in the list, we con...

2018-02-18 20:09
181
• #### 一篇文章搞懂leetcode位操作算法题

本文将根据题目总结常用的位操作常用的解决算法问题的技巧 Single Number落单的数 给出2*n + 1 个的数字，除其中一个数字之外其他每个数字均出现两次，找到这个数字。 思路： 一...

2018-02-21 19:27
77
• #### Weekly Contest 73 leetcode 788. Rotated Digits

X is a good number if after rotating each digit individually by 180 degrees, we get a valid number t...

2018-02-25 13:36
300
• #### Weekly Contest 73 leetcode 789. Escape The Ghosts

You are playing a simplified Pacman game. You start at the point (0, 0), and your destination is (...

2018-02-25 14:17
73
• #### Weekly Contest 73 leetcode 791. Custom Sort String

S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was...

2018-02-25 14:57
89