### LeetCode with Python

174 已关注
104篇博文
• #### -

-

2014-11-30 21:48
11939
• #### 【LeetCode with Python】 Spiral Matrix II

Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For...

2014-11-30 21:50
12378
• #### 【LeetCode with Python】 Spiral Matrix

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

2014-11-30 21:49
11513
• #### 【LeetCode with Python】 Valid Number

Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1...

2014-11-30 21:52
11560
• #### 【LeetCode with Python】 Sort List

Sort a linked list in O(n log n) time using constant space complexity.

2014-07-26 14:17
15239
• #### 【LeetCode with Python】 Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). Th...

2014-08-29 18:11
2821
• #### 【LeetCode with Python】 Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given...

2014-08-29 18:34
2759
• #### -

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise)....

2014-08-29 18:35
12950
• #### 【LeetCode with Python】 Remove Duplicates from Sorted List II

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

2014-08-29 18:36
2987
• #### 【LeetCode with Python】 Remove Duplicates from Sorted Array II

Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given...

2014-08-29 18:37
2649
• #### 【LeetCode with Python】 Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C wher...

2014-09-21 17:30
15758
• #### 【LeetCode with Python】 Candy

There are N children standing in a line. Each child is assigned a rating value. You are giving cand...

2014-09-21 17:31
2595
• #### 【LeetCode with Python】 Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For examp...

2014-09-21 17:33
2513
• #### 【LeetCode with Python】 Combination Sum II

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in...

2014-09-21 17:33
2741
• #### 【LeetCode with Python】 Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST.

2014-09-21 17:35
2716
• #### 【LeetCode with Python】 Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point t...

2014-09-21 17:35
2595
• #### 【LeetCode with Python】 Divide Two Integers

Divide two integers without using multiplication, division and mod operator. If it is overflow, ret...

2014-09-21 17:37
9632
• #### 【LeetCode with Python】 Count and Say

The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221...

2014-09-21 17:38
9812
• #### 【LeetCode with Python】 Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place. For example, Given 1 /...

2014-09-21 17:38
10146
• #### 【LeetCode with Python】 Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

2014-09-21 17:41
10223