public class Solution { public String intToRoman(int num) { int[] digits = new int[4]; int i = 0; String s = ""; digits...
分类:
其他好文 时间:
2016-01-15 08:43:14
阅读次数:
164
required: "必选字段", remote: "请修正该字段", email: "请输入正确格式的电子邮件", url: "请输入合法的网址", date: "请输入合法的日期", dateISO: "请输入合法的日期 (ISO).", number: "请输入合法的数字", digits: ...
分类:
其他好文 时间:
2016-01-12 10:07:55
阅读次数:
213
https://leetcode.com/problems/sum-root-to-leaf-numbers/Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a n...
分类:
其他好文 时间:
2016-01-11 22:16:10
阅读次数:
136
Add Digits: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the proc...
分类:
其他好文 时间:
2016-01-11 20:15:25
阅读次数:
175
Reverse Integer:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return –321 题意:反转整数,不改变正负号。 思路: 逐步对给定的整数进行取余和求整,初始化最初的结...
分类:
其他好文 时间:
2016-01-11 20:12:53
阅读次数:
119
leetcode 258 Add Digits题目翻译: 给出一个非负整数num,不断地把它所有数字相加,直到最后剩下一个数字。 例如:num=38,计算过程如,3+8=11,1+1=2,所以2就是最后的数字,返回它就可以了。 并且,你能不使用任何循环或者递归,在O(1)的复杂度内完成吗? ...
分类:
其他好文 时间:
2016-01-10 21:19:49
阅读次数:
204
Given any integer 0 ≤ n ≤ 10000 not divisibleby 2 or 5, some multiple of n is a number whichin decimal notation is a sequence of 1’s. Howmany digits a...
分类:
其他好文 时间:
2016-01-06 00:04:41
阅读次数:
280
Plus One: 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 ...
分类:
其他好文 时间:
2016-01-05 13:59:28
阅读次数:
180
放假无聊,翻看自己博客的时候发现自己前面写的 那个base36兑换码在翻阅的时候 想到一个更简单的办法实现。但是随机上来说可能没有前者那么高但是觉得也没有多大的问题 发上来 自己再想想import stringimport randommaka = string.digits + string.as...
分类:
编程语言 时间:
2016-01-03 19:33:57
阅读次数:
168
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent
a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the tota...
分类:
其他好文 时间:
2016-01-01 19:07:40
阅读次数:
185