leetcode
文章平均质量分 54
cc不会飞
这个作者很懒,什么都没留下…
展开
-
count primes
Count Primes Description: Count the number of prime numbers less than a non-negative number, n 1. 给定一个数n,初始化一个长度比n稍微大一点的数组,num[n+1],将其初始化为1. 2. (判断m是否是素数的标准是是否存在{2, ..., sqrt(m)}原创 2015-05-03 00:35:27 · 334 阅读 · 0 评论 -
Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 --> 4 --> 5 此题的解法在与维护两个指针。p和q,p指向当原创 2015-05-03 18:08:31 · 709 阅读 · 0 评论 -
Number of Digit One
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. For example: Given n = 13, Return 6, because digit 1 occurred in the follow原创 2015-11-18 17:16:43 · 445 阅读 · 2 评论