题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes?...
分类:
其他好文 时间:
2015-04-15 23:20:59
阅读次数:
159
DescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to ...
分类:
其他好文 时间:
2015-04-15 23:11:05
阅读次数:
133
题目:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font...
分类:
其他好文 时间:
2015-04-15 22:53:32
阅读次数:
153
DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 2 #include 3 #include 4 #include 5...
分类:
其他好文 时间:
2015-04-15 21:20:22
阅读次数:
206
#includeint main(){ int a[50],i,j,t,n; //scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("\n input number of date:"); scanf("%d",&n); printf("input %d munb...
分类:
其他好文 时间:
2015-04-15 21:16:56
阅读次数:
120
Counting bits set (naive way)unsigned int v; // count the number of bits set in vunsigned int c; // c accumulates the total bits set in vfor (c = 0; v...
分类:
其他好文 时间:
2015-04-15 21:07:12
阅读次数:
256
/* 题意:给一个整数数组,每一个元素出现三次,只有一个元素出现一次,找出那个数(target数) 解法:用位运算做,统计整个数组每一位1的个数,然后对3取模,因为如果在第i位target数为0, 那么bit%3就为0,否则为1,对bit进行左移操作,然后直接累加结果。*/clas...
分类:
其他好文 时间:
2015-04-15 20:53:55
阅读次数:
109
FreeMaker 在遍历map ,当Map的key 定义了Integer时,会报Expected number, sequence, or string. i.imageUrl evaluated instead to freemarker.template.SimpleHash 异常,因为FreeMaker不支持遍历key为Integer...
分类:
其他好文 时间:
2015-04-15 19:47:31
阅读次数:
367
题目链接:number-of-islands
/**
*
Given a 2d grid map of '1's (land) and '0's (water),
count the number of islands. An island is surrounded by water
and is formed by connecting adjacent land...
分类:
其他好文 时间:
2015-04-15 19:40:44
阅读次数:
179
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2015-04-15 19:16:18
阅读次数:
127