Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-07-22 22:52:33
阅读次数:
166
创建表: hive> CREATE TABLE pokes (foo INT, bar STRING); Creates a table called pokes with two columns, the first being an integer and the other a string....
分类:
其他好文 时间:
2014-07-22 22:50:54
阅读次数:
262
Power StringsTime Limit: 3000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descrip...
分类:
其他好文 时间:
2014-07-22 09:00:03
阅读次数:
256
AtomicInteger,一个提供原子操作的Integer的类。在Java语言中,++i和i++操作并不是线程安全的,在使用的时候,不可避免的会用到synchronized关键字。而AtomicInteger则通过一种线程安全的加减操作接口。 来看Ato...
分类:
编程语言 时间:
2014-07-22 08:10:35
阅读次数:
196
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.题解:转换的方法:从左往右扫描罗马字符,如果当前的字符对应的数字比上一个数字小,就直接加...
分类:
其他好文 时间:
2014-07-21 10:05:42
阅读次数:
223
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.题解:基本的罗马字符和数字对应如下表所示:罗马字符数字I1V5X10L50C100D50...
分类:
其他好文 时间:
2014-07-21 10:05:16
阅读次数:
286
Additive equationsDescription We all understand that an integer set is a collection of distinct integers. Now the question is: given an integer set...
分类:
其他好文 时间:
2014-07-21 09:35:45
阅读次数:
293
Determine whether an integer is a palindrome. Do this without extra space.
判断一个int值是否为回文数。
本题有几点需要注意:
(1)不能用额外存储空间,也就是说只能用常数空间解决;诸如将int转换为string再去比较字符是不可行的;
(2)判断回文数的方法有两个:从中间开始向两头判断、从两头向中间判断;后者更简...
分类:
其他好文 时间:
2014-07-19 23:22:39
阅读次数:
345
Description
Black Box
Our Black Box represents a primitive database. It can save an integer array and has a special
i variable. At the initial moment Black Box is empty and...
分类:
其他好文 时间:
2014-07-19 12:06:45
阅读次数:
199
Power of Fibonacci
Time Limit: 5 Seconds Memory Limit: 65536 KB
In mathematics, Fibonacci numbers or Fibonacci series or Fibonacci sequence are the numbers of the following integer sequence...
分类:
其他好文 时间:
2014-07-19 11:48:45
阅读次数:
239