原创 LeetCode 各題目難度已經面試頻率

              1 Two Sum 2 5 array sort         set Two Pointers

原创 LeetCode :: Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 題目比較簡單,給出的函數原型int reverse

原创 LeetCode :: 1.Balanced Binary Tree [樹類題目分析]

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined a

原创 LeetCode :: 3.Path Sum [樹類題目分析]

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along

原创 LeetCode 開篇

經歷了一些人,一些事,深深地認識到自己的不足,感覺應該腳踏實地地去工作、去學習,冰凍三尺,非一日之寒。 首先,先從Leetcode這樣一個經典的網站開始吧,一天寫一些,更一些,好像網上有很多題解,但是好多都寫得不是那麼清楚或者寫的很晦澀,

原创 LeetCode :: Palindrome

今天真是lucky,隨機到的題目都比較簡單。 這裏判斷迴文數字。Determine whether an integer is a palindrome. Do this without extra space. 題目也是很簡短,唯一值得

原创 LeetCode :: Remove Duplicates from Sorted Array II 詳細分析

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

原创 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 Subarray 詳細分析

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

原创 LeetCode :: Pow(x, n)

題目要求很簡潔,Implement pow(x, n),沒了。函數的原型是這樣的:double pow(double x, int n) ;一、這裏最容易想到的,肯定是時間複雜度爲O(N), 利用一個遞歸,我試了一下,果然和想的一樣 T

原创 LeetCode :: Remove Nth Node From End of List [詳細分析]

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list:

原创 LeetCode :: Remove Duplicates from Sorted Array [詳細分析]

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length

原创 LeetCode :: 2.Minimum Depth of Binary Tree [樹類題目分析]

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from th

原创 LeetCode :: Remove Element

Given an array and a value, remove all instances of that value in place and return the new length. The order of eleme

原创 LeetCode :: Container With Most Water

題目如下: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical