rt,直接猜1
First Digit
Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge
Benford's Law, also called the First-Digit Law, refers to the frequency distribution of digits i...
分类:
其他好文 时间:
2014-06-20 13:04:39
阅读次数:
277
n! means n (n
1)
...
3
2
1
For example, 10! = 10 9
...
3
2
1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
Find the sum of the digits...
分类:
其他好文 时间:
2014-06-20 09:34:10
阅读次数:
215
原题地址:https://oj.leetcode.com/problems/plus-one/题意:Given
a non-negative number represented as an array of digits, plus one to the
number.The digits are...
分类:
编程语言 时间:
2014-06-11 11:25:27
阅读次数:
304
Add Two Numbers
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...
分类:
其他好文 时间:
2014-06-11 00:35:15
阅读次数:
243
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 it as a link...
分类:
其他好文 时间:
2014-06-08 15:30:28
阅读次数:
227
题目
A message containing letters from A-Z is being encoded to numbers using
the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine ...
分类:
其他好文 时间:
2014-06-08 15:30:08
阅读次数:
182
题目
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321。
解题思路:
颠倒一个整数中数字的位置,哈哈,类似翻转字符串一样,只不过整数需要计算,需要考虑溢出,其他无而。写出代码不难,只是溢出的时候怎么办,我这里是按照返回-1处理的,在leetcode上可以AC。
代码实现:...
分类:
其他好文 时间:
2014-06-08 14:47:58
阅读次数:
257
题目
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.3...
分类:
其他好文 时间:
2014-06-08 10:37:47
阅读次数:
273
Given a non-negative number represented as an
array of digits, plus one to the number.The digits are stored such that the most
significant digit is at...
分类:
其他好文 时间:
2014-06-07 16:56:28
阅读次数:
188
Given a binary tree containing digits
from0-9only, each root-to-leaf path could represent a number.An example is the
root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-06-06 12:38:42
阅读次数:
255