随笔分类 -  Leetcode

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页
摘要:Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3- 阅读全文
posted @ 2016-08-06 07:43 amazingzoe 阅读(112) 评论(0) 推荐(0)
摘要:Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2016-08-06 04:20 amazingzoe 阅读(135) 评论(0) 推荐(0)
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you 阅读全文
posted @ 2016-08-06 03:34 amazingzoe 阅读(106) 评论(0) 推荐(0)
摘要:Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example:(1) Given nums = [1, 5, 1, 1, 6, 4], one possible 阅读全文
posted @ 2016-08-06 03:32 amazingzoe 阅读(135) 评论(0) 推荐(0)
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2016-08-05 05:43 amazingzoe 阅读(158) 评论(0) 推荐(0)
摘要:According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2016-08-01 01:01 amazingzoe 阅读(155) 评论(0) 推荐(0)
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
posted @ 2016-07-31 14:30 amazingzoe 阅读(134) 评论(0) 推荐(0)
摘要:Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements ofnums except n 阅读全文
posted @ 2016-07-31 01:20 amazingzoe 阅读(164) 评论(0) 推荐(0)
摘要:Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. Analy 阅读全文
posted @ 2016-07-31 01:01 amazingzoe 阅读(123) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文
posted @ 2016-07-21 15:12 amazingzoe 阅读(134) 评论(0) 推荐(0)
摘要:A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2016-07-05 13:34 amazingzoe 阅读(111) 评论(0) 推荐(0)
摘要:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic 阅读全文
posted @ 2016-07-05 12:58 amazingzoe 阅读(113) 评论(0) 推荐(0)
摘要:Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do 阅读全文
posted @ 2016-02-29 00:53 amazingzoe 阅读(171) 评论(0) 推荐(0)
摘要:Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if 阅读全文
posted @ 2016-02-27 00:54 amazingzoe 阅读(172) 评论(0) 推荐(0)
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2016-02-23 10:46 amazingzoe 阅读(147) 评论(0) 推荐(0)
摘要:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文
posted @ 2016-02-23 05:57 amazingzoe 阅读(192) 评论(0) 推荐(0)
摘要:There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t 阅读全文
posted @ 2016-02-18 06:44 amazingzoe 阅读(168) 评论(0) 推荐(0)
摘要:Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the". Update (2015-02-12):For C pr 阅读全文
posted @ 2016-02-12 11:40 amazingzoe 阅读(137) 评论(0) 推荐(0)
摘要:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to 阅读全文
posted @ 2016-02-04 06:28 amazingzoe 阅读(196) 评论(0) 推荐(0)
摘要:Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assum 阅读全文
posted @ 2016-02-04 06:09 amazingzoe 阅读(167) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页