LeetCode 292. Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 sto...

2019-06-16 11:54:47

阅读数 13

评论数 0

LeetCode 138. Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return adeep cop...

2019-06-12 15:41:08

阅读数 15

评论数 0

LeetCode 116. Populating Next Right Pointers in Each Node

You are given aperfect binary treewhereall leaves are on the same level, and every parent has two children. The binary tree has the following definit...

2019-06-10 16:51:51

阅读数 19

评论数 0

LeetCode 91. Decode Ways

A message containing letters fromA-Zis being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 ...

2019-06-10 15:38:04

阅读数 14

评论数 0

LeetCode 54. Spiral Matrix

Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], ...

2019-06-10 14:57:57

阅读数 16

评论数 0

LeetCode 912. Sort an Array

Given an array of integersnums, sort the array in ascending order. Example 1: Input:[5,2,3,1] Output: [1,2,3,5] Example 2: Input: [5,1,1,2,0...

2019-06-10 12:06:52

阅读数 24

评论数 0

LeetCode 127. Word Ladder

Given two words (beginWordandendWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWordtoendWord, such...

2019-06-04 10:22:30

阅读数 20

评论数 0

LeetCode 227. Basic Calculator II

Implement a basic calculator to evaluate a simple expression string. The expression string contains onlynon-negativeintegers,+,-,*,/operators and em...

2019-06-03 16:34:33

阅读数 18

评论数 0

LeetCode 103. Binary Tree Zigzag Level Order Traversal

Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and a...

2019-06-03 15:09:14

阅读数 18

评论数 0

LeetCode 394. Decode String

Given an encoded string, return it's decoded string. The encoding rule is:k[encoded_string], where theencoded_stringinside the square brackets is be...

2019-06-02 15:30:42

阅读数 17

评论数 0

LeetCode 236. Lowest Common Ancestor of a Binary Tree

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to thedefinition of LCA on Wikipedia: “The lowe...

2019-06-02 14:37:33

阅读数 18

评论数 0

LeetCode 208. Implement Trie (Prefix Tree)

Implement a trie withinsert,search, andstartsWithmethods. Example: Trie trie = new Trie(); trie.insert("apple"); trie.search("appl...

2019-06-01 19:12:01

阅读数 17

评论数 0

LeetCode 148. Sort List

Sort a linked list inO(nlogn) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->...

2019-06-01 16:30:48

阅读数 16

评论数 0

LeetCode 102. Binary Tree Level Order Traversal

Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree[3...

2019-06-01 14:48:13

阅读数 15

评论数 0

LeetCode 166. Fraction to Recurring Decimal

Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeati...

2019-05-31 18:32:22

阅读数 15

评论数 0

LeetCode 29. Divide Two Integers

Given two integersdividendanddivisor, divide two integers without using multiplication, division and mod operator. Return the quotient after dividin...

2019-05-31 18:06:36

阅读数 16

评论数 0

LeetCode 334. Increasing Triplet Subsequence

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true ...

2019-05-31 17:32:34

阅读数 39

评论数 0

LeetCode 739. Daily Temperatures

Given a list of daily temperaturesT, return a list such that, for each day in the input, tells you how many days you would have to wait until a warme...

2019-05-31 17:25:47

阅读数 33

评论数 0

LeetCode 406. Queue Reconstruction by Height

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers(h, k), wherehis the height of the person...

2019-05-31 17:20:59

阅读数 18

评论数 0

LeetCode 50. Pow(x, n)

Implementpow(x,n), which calculatesxraised to the powern(xn). Example 1: Input: 2.00000, 10 Output: 1024.00000 Example 2: Input: 2.10000, 3 Ou...

2019-05-30 15:26:28

阅读数 17

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭