### LeetCode-Python

15 已关注
101篇博文
• #### leetcode: 100. Same Tree

QGiven two binary trees, write a function to check if they are the same or not.Two binary trees are ...

2017-11-23 09:02
267
• #### leetcode: 99. Recover Binary Search Tree

QTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing...

2017-11-23 09:01
276
• #### leetcode: 98. Validate Binary Search Tree

QGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as...

2017-11-23 09:00
248
• #### leetcode: 97. Interleaving String

QGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example, Given: ...

2017-11-22 10:25
265
• #### leetcode: 96. Unique Binary Search Trees

QGiven n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example...

2017-11-22 10:24
197
• #### leetcode: 95. Unique Binary Search Trees II [✗]

QGiven an integer n, generate all structurally unique BST’s (binary search trees) that store values ...

2017-11-22 10:23
202
• #### leetcode: 94. Binary Tree Inorder Traversal

QGiven a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary t...

2017-11-22 10:23
216
• #### leetcode: 93. Restore IP Addresses

QGiven a string containing only digits, restore it by returning all possible valid IP address combin...

2017-11-22 10:22
196
• #### leetcode: 92. Reverse Linked List II

QReverse a linked list from position m to n. Do it in-place and in one-pass.For example: Given 1->2...

2017-11-22 10:22
190
• #### leetcode: 91. Decode Ways

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

2017-11-22 10:21
230
• #### leetcode: 90. Subsets II

QGiven a collection of integers that might contain duplicates, nums, return all possible subsets (th...

2017-11-22 10:21
216
• #### leetcode: 89. Gray Code

QThe gray code is a binary numeral system where two successive values differ in only one bit.Given a...

2017-11-22 10:20
257
• #### leetcode: 88. Merge Sorted Array

QGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: ...

2017-11-21 10:12
231
• #### leetcode: 87. Scramble String

QGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substri...

2017-11-21 10:12
199
• #### leetcode: 86. Partition List

QGiven a linked list and a value x, partition it such that all nodes less than x come before nodes g...

2017-11-21 10:11
205
• #### leetcode: 85. Maximal Rectangle

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

2017-11-21 10:11
215
• #### leetcode: 84. Largest Rectangle in Histogram

Problem# Given n non-negative integers representing the histogram's bar height where the width of ea...

2017-11-21 10:10
223
• #### leetcode: 83. Remove Duplicates from Sorted List

QGiven a sorted linked list, delete all duplicates such that each element appear only once.For examp...

2017-11-21 10:10
207
• #### leetcode: 82. Remove Duplicates from Sorted List II

QGiven a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct num...

2017-11-21 10:09
262
• #### leetcode: 81. Search in Rotated Sorted Array II

QFollow up for "Search in Rotated Sorted Array": What if duplicates are allowed?Would this affect th...

2017-11-21 10:08
257