2015年8月31日

[LeetCode] 34 - Search for a Range

摘要: Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文

posted @ 2015-08-31 14:25 tuituji 阅读(118) 评论(0) 推荐(0) 编辑

[LeetCode] 35 - Search Insert Position

摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... 阅读全文

posted @ 2015-08-31 11:05 tuituji 阅读(141) 评论(0) 推荐(0) 编辑

2015年8月29日

[LeetCode] 23 - Merge k Sorted Lists

摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-linked list. * struct List... 阅读全文

posted @ 2015-08-29 16:47 tuituji 阅读(121) 评论(0) 推荐(0) 编辑

[LeetCode] 22 - Generate Parentheses

摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文

posted @ 2015-08-29 15:22 tuituji 阅读(117) 评论(0) 推荐(0) 编辑

[LeetCode] 16 - 3Sum Closest

摘要: Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m... 阅读全文

posted @ 2015-08-29 14:37 tuituji 阅读(178) 评论(0) 推荐(0) 编辑

[LeetCode] 15 - 3Sum

摘要: 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:Elemen... 阅读全文

posted @ 2015-08-29 13:53 tuituji 阅读(180) 评论(0) 推荐(0) 编辑

2015年8月28日

[LeetCode] 232 - Implement Queue using Stacks

摘要: Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o... 阅读全文

posted @ 2015-08-28 21:46 tuituji 阅读(138) 评论(0) 推荐(0) 编辑

[LeetCode] 260 - Single Number III

摘要: Given an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements t... 阅读全文

posted @ 2015-08-28 21:37 tuituji 阅读(225) 评论(0) 推荐(0) 编辑

[LeetCode] 268 - Missing Number

摘要: Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1, 3]retur... 阅读全文

posted @ 2015-08-28 21:10 tuituji 阅读(126) 评论(0) 推荐(0) 编辑

[LeetCode] 187 - Repeated DNA Sequences

摘要: 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 @ 2015-08-28 11:52 tuituji 阅读(105) 评论(0) 推荐(0) 编辑

导航