Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here a ...
分类:
其他好文 时间:
2017-02-03 00:32:34
阅读次数:
184
【Numeric Type Attributes】 INT(4) specifies an INT with a display width of four digits. This optional display width may be used by applications to disp ...
分类:
其他好文 时间:
2017-02-01 15:37:47
阅读次数:
126
题目: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is l ...
分类:
其他好文 时间:
2017-01-25 15:26:48
阅读次数:
197
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai ...
分类:
其他好文 时间:
2017-01-25 11:49:19
阅读次数:
282
Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume the integer do not conta ...
分类:
其他好文 时间:
2017-01-23 15:30:32
阅读次数:
231
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 这道题要考虑反转之后overflow的问题,感觉我的写法很非主流啊。 还是用主流写法又写了一下 ...
分类:
其他好文 时间:
2017-01-20 09:45:38
阅读次数:
219
数据类型 数据操作 bytes 类型 "".encode() 编码-->二进制 "".decode() 解码 判断字符串里的字符是否全为数字 "".isdigit(), Return True if all characters in S are digits 数据运算: 算数运算: + - * / ...
分类:
编程语言 时间:
2017-01-17 10:49:29
阅读次数:
227
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 个人的大体思路: 先判断是整数还是负数,flag记录符号(-1或1),把数字取绝对值然后转换成字符串,字符串逆序,把字 ...
分类:
其他好文 时间:
2017-01-17 07:51:09
阅读次数:
260
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin ...
分类:
其他好文 时间:
2017-01-16 09:51:39
阅读次数:
163
http://www.ifrog.cc/acm/problem/1083 题意:比较好懂。注意答案的x不包含ax本身,所以才输出-1。 思路:离线处理。根据x排序,然后每次更新Hash[]数组就好了。 ...
分类:
其他好文 时间:
2017-01-14 16:57:42
阅读次数:
196