230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ B...

2018-08-31 18:15:44

阅读数:22

评论数:0

11. Container With Most Water

Given n non-negative integers a1,a2,...,ana1,a2,...,ana_1, a_2, ..., a_n, where each represents a point at coordinate (i,ai)(i,ai)(i, a_i). n vertica...

2018-04-19 16:35:37

阅读数:9

评论数:0

5. Longest Palindromic Substring

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: “babad” O...

2018-04-17 11:35:49

阅读数:39

评论数:0

3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is ...

2018-04-12 15:54:11

阅读数:11

评论数:0

2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes conta...

2018-04-11 11:17:34

阅读数:11

评论数:0

463. Island Perimeter

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/v...

2018-04-10 11:34:34

阅读数:14

评论数:0

461. Hamming Distance

The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calc...

2018-04-10 11:01:38

阅读数:10

评论数:0

459. Repeated Substring Pattern

Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may ...

2018-04-09 16:32:31

阅读数:11

评论数:0

455. Assign Cookies

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child iii has ...

2018-04-09 10:49:11

阅读数:10

评论数:0

453. Minimum Moves to Equal Array Elements

Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n...

2018-04-02 17:29:43

阅读数:16

评论数:0

448. Find All Numbers Disappeared in an Array

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n...

2018-04-02 17:06:54

阅读数:12

评论数:0

447. Number of Boomerangs(飞去来器)

Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equal...

2018-03-30 10:53:16

阅读数:33

评论数:0

443. String Compression

Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ...

2018-03-30 09:49:51

阅读数:11

评论数:0

438. Find All Anagrams in a String

Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s. Strings consists of lowercase English letters only and t...

2018-03-28 22:44:12

阅读数:17

评论数:0

441. Arranging Coins

You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total numb...

2018-03-24 15:42:09

阅读数:21

评论数:0

113. Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For example: Given the below binary tree and...

2018-03-21 11:40:51

阅读数:16

评论数:0

437. Path Sum III

You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not nee...

2018-03-21 11:07:34

阅读数:13

评论数:0

434. Number of Segments in a String

Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the strin...

2018-03-21 10:01:21

阅读数:9

评论数:0

415. Add Strings

Given two non-negative integers num1 and num2represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is &am...

2018-03-20 11:38:37

阅读数:19

评论数:0

414. Third Maximum Number

Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complex...

2018-03-20 10:30:01

阅读数:15

评论数:0

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