摘要:
题目连接https://leetcode.com/problems/pascals-triangle/Pascal's TriangleDescriptionGiven numRows, generate the first numRows of Pascal’s triangle.For exam...
阅读全文
posted @ 2015-12-09 20:26
GadyPu
阅读(149)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/triangle/TriangleDescriptionGiven a triangle, find the minimum path sum from top to bottom. Each step you may move t...
阅读全文
posted @ 2015-12-09 20:24
GadyPu
阅读(153)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/valid-palindrome/Valid PalindromeDescriptionGiven a string, determine if it is a palindrome, considering only alphan...
阅读全文
posted @ 2015-12-09 20:20
GadyPu
阅读(175)
推荐(0)
摘要:
题目连接 https://leetcode.com/problems/word-ladder/ Word Ladder Description Given two words (beginWord and endWord), and a dictionary’s word list, find th
阅读全文
posted @ 2015-12-09 20:17
GadyPu
阅读(161)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/longest-consecutive-sequence/Longest Consecutive SequenceDescriptionGiven an unsorted array of integers, find the le...
阅读全文
posted @ 2015-12-09 20:15
GadyPu
阅读(164)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/sum-root-to-leaf-numbers/Sum Root to Leaf NumbersDescriptionGiven a binary tree containing digits from 0-9 only, eac...
阅读全文
posted @ 2015-12-09 20:12
GadyPu
阅读(139)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/clone-graph/Clone GraphDescriptionClone an undirected graph. Each node in the graph contains a label and a list of i...
阅读全文
posted @ 2015-12-09 20:09
GadyPu
阅读(144)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/evaluate-reverse-polish-notation/Evaluate Reverse Polish NotationDescriptionEvaluate the value of an arithmetic expr...
阅读全文
posted @ 2015-12-09 20:07
GadyPu
阅读(145)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/reverse-words-in-a-string/Reverse Words in a StringDescriptionGiven an input string, reverse the string word by word...
阅读全文
posted @ 2015-12-09 20:04
GadyPu
阅读(137)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/min-stack/Min StackDescriptionDesign a stack that supports push, pop, top, and retrieving the minimum element in con...
阅读全文
posted @ 2015-12-09 20:02
GadyPu
阅读(141)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/excel-sheet-column-title/Excel Sheet Column TitleDescriptionGiven a positive integer, return its corresponding colum...
阅读全文
posted @ 2015-12-09 19:58
GadyPu
阅读(160)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/majority-element/Majority ElementDescriptionGiven an array of size n, find the majority element. The majority elemen...
阅读全文
posted @ 2015-12-09 19:56
GadyPu
阅读(115)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/excel-sheet-column-number/Excel Sheet Column NumberDescriptionRelated to question Excel Sheet Column TitleGiven a co...
阅读全文
posted @ 2015-12-09 19:54
GadyPu
阅读(193)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/rotate-array/Rotate ArrayDescriptionRotate an array of n elements to the right by k steps.For example, with n = 7 an...
阅读全文
posted @ 2015-12-09 19:51
GadyPu
阅读(139)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/reverse-bits/Reverse BitsDescriptionReverse bits of a given 32 bits unsigned integer.For example, given input 432615...
阅读全文
posted @ 2015-12-08 09:50
GadyPu
阅读(161)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/number-of-1-bits/Number of 1 BitsDescriptionWrite a function that takes an unsigned integer and returns the number o...
阅读全文
posted @ 2015-12-08 09:47
GadyPu
阅读(129)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/number-of-islands/Number of IslandsDescriptionGiven a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number ...
阅读全文
posted @ 2015-12-08 09:44
GadyPu
阅读(166)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/happy-number/Happy NumberDescriptionWrite an algorithm to determine if a number is “happy”.A happy number is a numbe...
阅读全文
posted @ 2015-12-08 09:41
GadyPu
阅读(187)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/remove-linked-list-elements/Remove Linked List ElementsDescriptionRemove all elements from a linked list of integers...
阅读全文
posted @ 2015-12-08 09:37
GadyPu
阅读(126)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/isomorphic-strings/Isomorphic StringsDescriptionGiven two strings s and t, determine if they are isomorphic.Two stri...
阅读全文
posted @ 2015-12-08 09:35
GadyPu
阅读(170)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/reverse-linked-list/Reverse Linked ListDescriptionReverse a singly linked list./** * Definition for singly-linked li...
阅读全文
posted @ 2015-12-08 09:32
GadyPu
阅读(108)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/course-schedule/Course ScheduleDescriptionThere are a total of n courses you have to take, labeled from 0 to n−1.Som...
阅读全文
posted @ 2015-12-08 09:28
GadyPu
阅读(168)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/binary-tree-paths/Binary Tree PathsDescriptionGiven a binary tree, return all root-to-leaf paths.For example, given ...
阅读全文
posted @ 2015-12-08 09:21
GadyPu
阅读(141)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/count-of-smaller-numbers-after-self/Count of Smaller Numbers After SelfDescriptionYou are given an integer array num...
阅读全文
posted @ 2015-12-06 18:36
GadyPu
阅读(637)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/implement-trie-prefix-tree/Implement Trie (Prefix Tree)DescriptionImplement a trie with insert, search, and startsWi...
阅读全文
posted @ 2015-12-04 22:33
GadyPu
阅读(153)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/course-schedule-ii/Course Schedule IIDescriptionThere are a total of n courses you have to take, labeled from 0 to n...
阅读全文
posted @ 2015-12-04 22:29
GadyPu
阅读(166)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/kth-largest-element-in-an-array/Kth Largest Element in an ArrayDescriptionFind the kth largest element in an unsorte...
阅读全文
posted @ 2015-12-04 22:25
GadyPu
阅读(163)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/basic-calculator/Basic CalculatorDescriptionImplement a basic calculator to evaluate a simple expression string.The ...
阅读全文
posted @ 2015-12-04 22:21
GadyPu
阅读(154)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/power-of-two/Power of TwoDescriptionGiven an integer, write a function to determine if it is a power of two.水一发pytho...
阅读全文
posted @ 2015-12-04 22:18
GadyPu
阅读(160)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/同上, 用二叉树的性质要快一些,懒得改了。。/** * Definition for a binary tree node. * stru...
阅读全文
posted @ 2015-12-04 22:14
GadyPu
阅读(134)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/Common Ancestor of a Binary TreeDescriptionGiven a binary tree, find the low...
阅读全文
posted @ 2015-12-04 22:11
GadyPu
阅读(132)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/delete-node-in-a-linked-list/Delete Node in a Linked ListDescriptionWrite a function to delete a node (except the ta...
阅读全文
posted @ 2015-12-04 22:03
GadyPu
阅读(141)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/search-a-2d-matrix-ii/Search a 2D Matrix IIDescriptionWrite an efficient algorithm that searches for a value in an m...
阅读全文
posted @ 2015-12-04 22:00
GadyPu
阅读(146)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/valid-anagram/Valid AnagramDescriptionGiven two strings s and t, write a function to determine if t is an anagram of...
阅读全文
posted @ 2015-12-04 21:55
GadyPu
阅读(167)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/add-digits/Add DigitsDescriptionGiven a non-negative integer num, repeatedly add all its digits until the result has...
阅读全文
posted @ 2015-12-04 21:50
GadyPu
阅读(150)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/single-number-iii/Single Number IIIDescriptionGiven an array of numbers nums, in which exactly two elements appear o...
阅读全文
posted @ 2015-12-04 21:47
GadyPu
阅读(132)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/ugly-number/Ugly NumberDescriptionWrite a program to check whether a given number is an ugly number.Ugly numbers are...
阅读全文
posted @ 2015-12-04 21:44
GadyPu
阅读(157)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/ugly-number-ii/Ugly Number IIDescriptionWrite a program to find the $n_{th}$ ugly number.Ugly numbers are positive n...
阅读全文
posted @ 2015-12-04 21:41
GadyPu
阅读(156)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/missing-number/Missing NumberDescriptionGiven an array containing n distinct numbers taken from$ 0, 1, 2, ..., n$, f...
阅读全文
posted @ 2015-12-04 21:38
GadyPu
阅读(122)
推荐(0)
摘要:
题目连接https://leetcode.com/problems/find-the-duplicate-number/Find the Duplicate NumberDescriptionGiven an array nums containing n + 1 integers where ea...
阅读全文
posted @ 2015-12-04 21:34
GadyPu
阅读(213)
推荐(0)