码迷,mamicode.com
首页 >  
搜索关键字:reverse integer    ( 19410个结果
Leetcode | First Missing Positive
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sho...
分类:其他好文   时间:2014-05-16 02:58:54    阅读次数:249
[leetcode]_String to Integer (atoi)
非常考虑思维全面性的一道题,考验是否能够考虑本问题的方方面面。题目:将一个string转换为int。实现函数atoi()的功能。先应该明确atoi()有哪些特殊功能:(正常的正负数情况我就不列了)inputoutput”+1“1” + 1“0(error了)” 1“1(前头只有空格是合法的...
分类:其他好文   时间:2014-05-16 01:08:33    阅读次数:245
leetcode Integer to Roman
把阿拉伯数字转换成罗马数字...
分类:其他好文   时间:2014-05-15 19:22:51    阅读次数:232
[leetcode]_Reverse Integer
经历了三道树的题后,完全崩溃中,急需一道非树图的题来挽救信心。题目:反转数字。input : 123 , output : 321.思路:直接,没什么好说的。自己代码:很龊,有大量的冗余信息,还申请了一个List,虽然AC了,但有很大改进空间。public int reverse(int x) { ...
分类:其他好文   时间:2014-05-15 14:22:31    阅读次数:212
奇葩的细节
public class Test { public static void main(String[] string){ int i = Integer.MAX_VALUE; System.out.println(i); ...
分类:其他好文   时间:2014-05-15 10:13:33    阅读次数:224
关于Interget
String s="32"; int i=Integer.parseInt(s); System.out.println(i);这样没有问题 String s="3g"; int i=Integer.parseInt(s); Sy...
分类:其他好文   时间:2014-05-15 09:23:50    阅读次数:234
java并发编程之Guarded Suspention
当客户端请求速度远远大于服务端的处理速度,这时候就非常适合使用GuardedSuspention模式packagecn.fcl.guardendSuspension; importjava.util.ArrayList; importjava.util.List; publicclassRequestQueue{ privateList<Integer>integers=newArrayList<Integer>(); ..
分类:编程语言   时间:2014-05-15 09:08:21    阅读次数:283
UVA之1121 - Subsequence
【题目】 A sequence of N positive integers (10 N , each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subse...
分类:其他好文   时间:2014-05-15 07:58:17    阅读次数:329
javascript 常用的数组操作
join()Array.join(/*optional*/separator)将数组转换为字符串,可带一个参数separator(分隔符,默认为“,”)。与之相反的一个方法是:String.splict(),将字符串分隔成若干块来创建一个新的数组。reverse()Array.reverse(),颠倒数组元素的顺序,返回逆向的数组.注意此方法会修..
分类:编程语言   时间:2014-05-15 00:31:23    阅读次数:441
Leetcode 数 String to Integer (atoi)
1.注意规则 2.注意最小的负数的绝对值比最大的正数的绝对值大1,所以 line 13: (str[i] - '0') > INT_MAX%10不能取等号...
分类:其他好文   时间:2014-05-14 23:52:26    阅读次数:478
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!