标题:Search a 2D Matrix通过率31.3%难度中等Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integ...
分类:
其他好文 时间:
2015-02-10 12:49:10
阅读次数:
152
标题:Set Matrix Zeroes通过率:31.3%难度:中等Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Fol...
分类:
其他好文 时间:
2015-02-09 12:43:33
阅读次数:
108
题目 题目很简单,就是写一个函数把string转换成int,但是通过率只有可怜的11%,难点是要考虑所有情况,特别是int溢出边界,反正我是写了2个小时还没解决,先放到这,有空接着搞,现在应该还有最后一个bug。Implement atoi to convert a string to an integer.Hint: Carefully consider all possible i...
分类:
其他好文 时间:
2015-02-07 11:43:19
阅读次数:
147
---恢复内容开始---标题:Letter Combinations of a Phone Number通过率:26.6%难度:中等Given a digit string, return all possible letter combinations that the number could ...
分类:
其他好文 时间:
2015-02-05 13:00:15
阅读次数:
173
标题:Best Time to Buy and Sell Stock II通过率:37.3%难度:中等Say you have an array for which theithelement is the price of a given stock on dayi.Design an algor...
分类:
其他好文 时间:
2015-02-02 12:28:59
阅读次数:
124
标题:Best Time to Buy and Sell Stock通过率:32%难度:中等Say you have an array for which theithelement is the price of a given stock on dayi.If you were only per...
分类:
其他好文 时间:
2015-02-02 12:18:58
阅读次数:
138
标题:Spiral Matrix II通过率:31.3难度:中等Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You s...
分类:
其他好文 时间:
2015-02-01 12:05:04
阅读次数:
198
原题地址计算循环小数先把负数转化成正数,然后计算,最后添加符号当被除数重复出现的时候,说明开始循环了,所以用一个map保存所有遇到的被除数需要考虑溢出问题,这也是本题最恶心的地方,看看通过率吧,比Hard难度的题还低。最残暴的做法是直接转成64位长整型,比如下面的代码。好处是代码简洁了许多,不过这是...
分类:
其他好文 时间:
2015-01-30 15:27:28
阅读次数:
153
标题:ZigZag Conversion通过率:22.7%难度:简单The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to displ...
分类:
其他好文 时间:
2015-01-28 14:23:47
阅读次数:
129
标题:Add Binary通过率:25.1%难度:简单Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".本题主要就是模拟二进制去处理,跟上次做到...
分类:
其他好文 时间:
2015-01-27 19:57:32
阅读次数:
107