7. Reverse Integer Easy Easy Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Out ...
分类:
其他好文 时间:
2019-08-27 23:18:48
阅读次数:
96
Description: For a non-negative integer X, the array-form of X is an array of its digits in left to right order. For example, if X = 1231, then the ar ...
分类:
其他好文 时间:
2019-08-27 17:35:04
阅读次数:
107
题目描述: 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 ...
分类:
其他好文 时间:
2019-08-27 12:20:14
阅读次数:
76
class Solution: def plusOne(self, digits: List[int]) -> List[int]: for i in reversed(range(len(digits))): if digits[i] == 9: digits[i] = 0 else: digit... ...
分类:
其他好文 时间:
2019-08-26 22:55:54
阅读次数:
80
PAT A1001 A+B Format 题目描述: Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas ...
分类:
其他好文 时间:
2019-08-26 15:13:36
阅读次数:
80
PAT A1005 Spell It Right 题目描述: Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the s ...
分类:
其他好文 时间:
2019-08-26 14:55:14
阅读次数:
59
A. Digits Sequence Dividing 题意:给你一个数字串,只包含1-9,让你至少分成两段,使得每一段的数字大于前一段的数字; 解:对n特判,如果n为2,那么比较一下两个数字大小,如果n>2,那么就可以直接分成两部分,第一部分1个数字,剩下都为第二部分; #include <bit ...
分类:
其他好文 时间:
2019-08-24 22:52:29
阅读次数:
112
/// <summary> Convert a string of hex digits (ex: E4 CA B2) to a byte array. </summary> /// <param name="s"> The string containing the hex digits (wit ...
A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and characte ...
分类:
其他好文 时间:
2019-08-21 09:51:41
阅读次数:
75
2018 2019, ICPC, Asia Yokohama Regional Contest 2018 "A Digits Are Not Just Characters" 签到。 "B Arithmetic Progressions" 题意:从给定的集合中选出最多的数构成等差数列。 题解:数字排 ...
分类:
其他好文 时间:
2019-08-19 20:43:50
阅读次数:
305