原创 LeetCode:Linked List Cycle I & II

Linked List Cycle Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using

原创 LeetCode:Regular Expression Matching

Regular Expression Matching   Implement regular expression matching with support for '.' and '*'. '.' Matches any

原创 LeetCode:Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In

原创 LeetCode:Simplify Path

Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/..

原创 LeetCode:Subsets I

Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descendin

原创 LeetCode:Maximum Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example,

原创 LeetCode:Unique Binary Search Trees

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

原创 LeetCode:Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2

原创 LeetCode:Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the

原创 LeetCode:Best Time to Buy and Sell Stock I & II & III

Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to

原创 LeetCode:Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NU

原创 LeetCode:Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it wo

原创 LeetCode:Populating Next Right Pointers in Each Node I & II

Populating Next Right Pointers in Each Node Given a binary tree struct TreeLinkNode { TreeLinkNode *le

原创 LeetCode:Single Number I && II

Given an array of integers, every element appears twice except for one. Find that single one. 題目很直接,直接建哈希表,遍歷,在表中就刪除元素

原创 Python:正則表達式

轉載自:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 1. 正則表達式基礎 1.1. 簡單介紹 正則表達式並不是Python的一部分。正則表達式是用於