码迷,mamicode.com
首页 >  
搜索关键字:刷题    ( 2326个结果
【leetcode刷题笔记】Largest Rectangle in Histogram
Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
分类:其他好文   时间:2014-07-24 22:39:53    阅读次数:252
【leetcode刷题笔记】Decode Ways
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:其他好文   时间:2014-07-24 21:56:32    阅读次数:219
【leetcode刷题笔记】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...
分类:其他好文   时间:2014-07-24 21:36:52    阅读次数:172
【leetcode刷题笔记】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...
分类:其他好文   时间:2014-07-24 21:24:16    阅读次数:296
【leetcode刷题笔记】Divide Two Integers
Divide two integers without using multiplication, division and mod operator.题解:要求不用乘除和取模运算实现两个数的除法。那么用加减法是很自然的选择。不过如果一次只从被除数中剪掉一个除数会TLE。所以我们借助移位运算,依次从...
分类:其他好文   时间:2014-07-24 17:09:15    阅读次数:203
【leetcode刷题笔记】Longest Valid Parentheses
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:其他好文   时间:2014-07-24 12:11:55    阅读次数:253
【leetcode刷题笔记】Valid Number
Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>true题解:题目不难,就是有点麻烦,要注意的地方很多,总结一下:前面和后面的空格要用s...
分类:其他好文   时间:2014-07-23 20:43:55    阅读次数:222
【leetcode刷题笔记】Merge Intervals
Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].题解:首先对所有的区间按照s...
分类:其他好文   时间:2014-07-23 18:01:57    阅读次数:210
【leetcode刷题笔记】Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题解:最开始用了最naive的方法,每次在k个链表头中找出最小的元素,插入到新链表中。结果果断TLE了。分析...
分类:其他好文   时间:2014-07-23 16:56:31    阅读次数:227
【leetcode刷题笔记】Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:其他好文   时间:2014-07-23 16:19:41    阅读次数:234
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!