随笔分类 -  LeetCode

上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 61 下一页
摘要:Given a sorted integer array nums, where the range of elements are in the inclusive range [lower, upper], return its missing ranges. Example: Input: n 阅读全文
posted @ 2016-02-08 07:21 Grandyang 阅读(16411) 评论(3) 推荐(2)
摘要:Given two strings s and t, determine if they are both one edit distance apart. Note: There are 3 possiblities to satisify one edit distance apart: Exa 阅读全文
posted @ 2016-02-07 14:34 Grandyang 阅读(17153) 评论(6) 推荐(0)
摘要:Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure.find 阅读全文
posted @ 2016-02-06 15:46 Grandyang 阅读(16159) 评论(6) 推荐(0)
摘要:Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick 阅读全文
posted @ 2016-02-05 15:22 Grandyang 阅读(21321) 评论(11) 推荐(0)
摘要:Given a file and assume that you can only read the file using a given method read4, implement a method read to read n characters. Your method read may 阅读全文
posted @ 2016-02-04 15:09 Grandyang 阅读(16809) 评论(10) 推荐(0)
摘要:Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Example: Input: nums = [3,5,2,1,6,4] Output: 阅读全文
posted @ 2016-02-02 13:22 Grandyang 阅读(22046) 评论(0) 推荐(0)
摘要:One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2016-02-01 10:52 Grandyang 阅读(11452) 评论(5) 推荐(0)
摘要:Given a file and assume that you can only read the file using a given method read4, implement a method to read n characters. Method read4: The API rea 阅读全文
posted @ 2016-02-01 02:54 Grandyang 阅读(18190) 评论(2) 推荐(0)
摘要:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
posted @ 2016-01-31 08:59 Grandyang 阅读(15764) 评论(3) 推荐(1)
摘要:Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected 阅读全文
posted @ 2016-01-28 15:14 Grandyang 阅读(17477) 评论(2) 推荐(0)
摘要:Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be for 阅读全文
posted @ 2016-01-28 12:42 Grandyang 阅读(11044) 评论(11) 推荐(1)
摘要:Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the eleme 阅读全文
posted @ 2016-01-27 11:33 Grandyang 阅读(18448) 评论(6) 推荐(0)
摘要:Given an m x n integers matrix, return the length of the longest increasing path in matrix. From each cell, you can either move in four directions: le 阅读全文
posted @ 2016-01-21 13:54 Grandyang 阅读(20060) 评论(8) 推荐(1)
摘要:Write a program to find the nthsuper ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime listprimesof s... 阅读全文
posted @ 2016-01-20 13:45 Grandyang 阅读(15550) 评论(2) 推荐(0)
摘要:Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example 1: Example 2: Note:You may assume all input has v 阅读全文
posted @ 2016-01-18 13:59 Grandyang 阅读(34675) 评论(12) 推荐(2)
摘要:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the... 阅读全文
posted @ 2016-01-18 13:20 Grandyang 阅读(14688) 评论(0) 推荐(1)
摘要:Given an integer, write a function to determine if it is a power of three. Example 1: Example 2: Example 3: Example 4: Follow up:Could you do it witho 阅读全文
posted @ 2016-01-18 06:41 Grandyang 阅读(19963) 评论(10) 推荐(0)
摘要:You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return  阅读全文
posted @ 2016-01-18 02:39 Grandyang 阅读(42268) 评论(17) 推荐(3)
摘要:Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. Th 阅读全文
posted @ 2016-01-17 07:07 Grandyang 阅读(18032) 评论(6) 推荐(0)
摘要:There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb. On the third round, you toggle every t 阅读全文
posted @ 2016-01-04 20:06 Grandyang 阅读(14707) 评论(7) 推荐(0)

上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 61 下一页
Fork me on GitHub