LeetCode的Python题解

52 已关注
12篇博文
• 【LeetCode】【Python题解】Rotate Image

一行解法以及酷炫解法

2014-09-20 15:11
3798
• 【LeetCode】【Python题解】Single NumberII

非常巧妙地解法！

2014-09-15 23:08
1912
• 【LeetCode】【Python题解】Pascal's Triangle

仅用一行实现！

2014-09-13 23:38
2358
• 【LeetCode】【Python】Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same colo...

2014-09-11 18:00
2314
• 【LeetCode】Balanced Tree & Binary Search Tree

整合两道差不多的题目放上来，其中第一题是第二题的基础。 1. Given a binary tree, determine if it is height-balanced. For this p...

2014-09-06 20:24
1997
• 【LeetCode】【Python】Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes' values. For example: Given bin...

2014-07-25 09:34
2349

Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without us...

2014-07-25 09:24
1576
• 【LeetCode】【Python题解】Single Number & Maximum Depth of Binary Tree

今天做了三道LeetCode上的简单题目，每道题都是用c++和Python两种语言写的，因为c++版的代码网上比较多，所以就只分享一下Python的代码吧，刚学完Python的基本语法，做做LeetC...

2014-07-20 13:18
3512
• 【LeetCode】【Python题解】Same Tree

Given two binary trees, write a function to check if they are equal or not. Two binary trees are ...

2014-07-20 20:01
3107
• 【LeetCode】【Python题解】Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 c...

2014-07-20 20:06
5574
• 【LeetCode】【Python题解】Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i. Design an...

2014-07-24 10:11
3278
• 【LeetCode】【Python题解】Unique Binary Search Trees

Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp...

2014-07-24 10:27
3084