摘要: 题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not poss... 阅读全文
posted @ 2014-07-02 15:01 ThreeMonkey 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After rem... 阅读全文
posted @ 2014-06-28 15:42 ThreeMonkey 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing... 阅读全文
posted @ 2014-06-26 20:52 ThreeMonkey 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should ... 阅读全文
posted @ 2014-06-26 20:24 ThreeMonkey 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters... 阅读全文
posted @ 2014-06-26 19:19 ThreeMonkey 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated ... 阅读全文
posted @ 2014-06-14 23:05 ThreeMonkey 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum ... 阅读全文
posted @ 2014-06-14 22:50 ThreeMonkey 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. Yo... 阅读全文
posted @ 2014-06-14 22:40 ThreeMonkey 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Ele... 阅读全文
posted @ 2014-06-14 22:28 ThreeMonkey 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL... 阅读全文
posted @ 2014-06-07 17:45 ThreeMonkey 阅读(148) 评论(0) 推荐(0) 编辑