bool result = false;
result = CheckPowerOfTwo(8);
Console.WriteLine(result.ToString());
static bool CheckPowerOfTwo(ulong number)
{
...
分类:
其他好文 时间:
2014-06-25 20:05:36
阅读次数:
141
ORA-01722: invalid number 寻找具体数据原因...
分类:
其他好文 时间:
2014-06-25 19:44:14
阅读次数:
169
【问题】
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
【思路】
对每一个点,分别计算这个点和其他所有点构成的斜率,具有相同斜率最多的点所构成的直线,就是具有最多点的直线。
【代码】
class Point:
def __in...
分类:
编程语言 时间:
2014-06-25 19:34:29
阅读次数:
246
SELECT t.*, @RowNum := @RowNum + 1 AS RowNumFROM t, (SELECT @RowNum := 0) AS myRowsMySQL中没有ROW_NUMBER()函数,可以用以上代码替换。
分类:
数据库 时间:
2014-06-25 17:32:15
阅读次数:
248
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-06-25 15:26:21
阅读次数:
203
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2014-06-25 09:15:12
阅读次数:
362
题目
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 for better legibility)
P A H ...
分类:
其他好文 时间:
2014-06-24 23:59:25
阅读次数:
338
题目
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return...
分类:
其他好文 时间:
2014-06-24 21:46:24
阅读次数:
249
题目
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the ent...
分类:
其他好文 时间:
2014-06-24 18:43:56
阅读次数:
224
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2014-06-24 15:52:58
阅读次数:
222