随笔分类 -  [LeetCode]

摘要:Problem:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the q... 阅读全文
posted @ 2015-09-08 12:24 airforce 阅读(519) 评论(0) 推荐(0)
摘要:Problem:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepe... 阅读全文
posted @ 2015-09-07 13:14 airforce 阅读(342) 评论(0) 推荐(0)
摘要:Problem:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read o... 阅读全文
posted @ 2015-09-07 12:20 airforce 阅读(361) 评论(0) 推荐(0)
摘要:Problem:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you... 阅读全文
posted @ 2015-09-07 06:25 airforce 阅读(366) 评论(0) 推荐(0)
摘要:Problem:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not... 阅读全文
posted @ 2015-09-07 04:38 airforce 阅读(180) 评论(0) 推荐(0)
摘要:Problem:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Analysis:The question is not har... 阅读全文
posted @ 2015-09-06 10:46 airforce 阅读(260) 评论(0) 推荐(0)
摘要:Problem:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra spa... 阅读全文
posted @ 2015-09-06 07:24 airforce 阅读(336) 评论(0) 推荐(0)
摘要:Problem:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Yo... 阅读全文
posted @ 2015-09-06 06:48 airforce 阅读(161) 评论(0) 推荐(0)
摘要:Problem:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the... 阅读全文
posted @ 2015-09-06 05:21 airforce 阅读(147) 评论(0) 推荐(0)
摘要:Problem:Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding ele... 阅读全文
posted @ 2015-09-05 12:03 airforce 阅读(188) 评论(0) 推荐(0)
摘要:Problem:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get ... 阅读全文
posted @ 2015-09-04 08:53 airforce 阅读(333) 评论(0) 推荐(0)
摘要:Problem:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and opera... 阅读全文
posted @ 2015-09-04 01:49 airforce 阅读(167) 评论(0) 推荐(0)
摘要:Problem:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.Ac... 阅读全文
posted @ 2015-09-04 00:53 airforce 阅读(565) 评论(0) 推荐(0)
摘要:Problem:Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another... 阅读全文
posted @ 2015-09-03 10:21 airforce 阅读(156) 评论(0) 推荐(0)
摘要:Problem:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is re... 阅读全文
posted @ 2015-09-03 09:36 airforce 阅读(198) 评论(0) 推荐(0)
摘要:Problem:Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"Analysis:This pr... 阅读全文
posted @ 2015-09-03 03:50 airforce 阅读(174) 评论(0) 推荐(0)
摘要:Problem:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are ... 阅读全文
posted @ 2015-09-03 01:34 airforce 阅读(164) 评论(0) 推荐(0)
摘要:Problem:Given a range [m, n] where 0 00111010101011...We can we reach the '1' in high index, all digits behind after it must change once. That's to s... 阅读全文
posted @ 2015-09-02 23:17 airforce 阅读(163) 评论(0) 推荐(0)
摘要:Problem:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive... 阅读全文
posted @ 2015-09-02 12:30 airforce 阅读(115) 评论(0) 推荐(0)
摘要:Problem:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Analysis:This problem is trivial, if... 阅读全文
posted @ 2015-09-02 11:33 airforce 阅读(131) 评论(0) 推荐(0)