【题目】
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
For example, given array S = {...
分类:
其他好文 时间:
2014-05-18 10:37:57
阅读次数:
269
【题目】
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter the values in the nodes, only n...
分类:
其他好文 时间:
2014-05-18 10:22:34
阅读次数:
367
Wrote by mutouyun. (http://darkc.at/a-tricky-code/)
刚刚在网上闲逛,看到reddit上关于最受欢迎的代码的讨论贴,上面有一小段非常有意思的代码:
unsigned int v; // to count the number of bits set in v
unsigned int c; // c accumulates the ...
分类:
其他好文 时间:
2014-05-18 07:44:31
阅读次数:
284
【题目】
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
Input:Digit string "23"
Output: ["ad", "ae", "af", "bd", "be", "bf",...
分类:
其他好文 时间:
2014-05-18 07:30:12
阅读次数:
340
Problem Description
For a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 + A1 *
1. Now you are given two numbers A and...
分类:
其他好文 时间:
2014-05-18 06:35:50
阅读次数:
300
-- =============================================
-- Author: ***
-- Create date: 2014-03-27 20:00
-- Description: 采用最新的 row_number() over 技术高...
分类:
数据库 时间:
2014-05-18 06:21:24
阅读次数:
317
怎样把数字转为字符串(与atoi相反)?有itoa函数吗?
用sprintf就可以了:
sprintf(string, "%d", number);同理,也可以同sprintf把long型或浮点型转换成字符串(使用%ld或%f),也就是说,可以把sprintf看成是atol或者atof的
反函数。
怎样在日期上加n天?怎样取得两个日期的时间间隔?
第一个问题,mktime接受没有...
分类:
编程语言 时间:
2014-05-18 06:20:21
阅读次数:
356
3SumClosest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution....
分类:
其他好文 时间:
2014-05-18 05:57:48
阅读次数:
244
B-number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2168 Accepted Submission(s): 1165
Problem Description
A wqb-number, or ...
分类:
其他好文 时间:
2014-05-18 03:32:19
阅读次数:
240
Given a linked list, reverse the nodes of a
linked list k at a time and return its modified list.If the number of nodes is
not a multiple of k then le...
分类:
其他好文 时间:
2014-05-18 01:53:53
阅读次数:
331