ount the number of prime numbers less than a non-negative number, n. 题目含义:要求计算小于N的所有素数的个数。素数又称质数,是只能被1和自身整数的数 思路:厄拉多塞筛法 其实,当你要画圈的素数的平方大于 n 时,那么后面没有划去的 ...
分类:
其他好文 时间:
2017-10-20 21:50:54
阅读次数:
212
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 like: ...
分类:
其他好文 时间:
2017-10-20 21:38:54
阅读次数:
172
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-10-20 21:32:21
阅读次数:
246
Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that ...
分类:
其他好文 时间:
2017-10-20 11:52:11
阅读次数:
139
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t ...
分类:
其他好文 时间:
2017-10-19 15:02:32
阅读次数:
164
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: 题目含义:计算两个非负整数的乘法,并用string返回 思路: 方法二: ...
分类:
其他好文 时间:
2017-10-17 18:45:55
阅读次数:
159
Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak ...
分类:
其他好文 时间:
2017-10-16 21:36:40
阅读次数:
128
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t ...
分类:
其他好文 时间:
2017-10-16 19:39:41
阅读次数:
142
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2017-10-16 19:33:28
阅读次数:
127
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2017-10-16 09:42:49
阅读次数:
105