![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
狢子
这个作者很懒,什么都没留下…
展开
-
[LeetCode]Count Primes素数个数
LeetCode题目: Description: Count the number of prime numbers less than a non-negative number, n. Credits: Special thanks to @mithmatt for adding this problem and creating all test cases.原创 2017-02-13 04:39:27 · 605 阅读 · 0 评论 -
[LeedCode]Count Primes素数个数
Leetcode题目: Description:Count the number of prime numbers less than a non-negative number, n.Credits: Special thanks to @mithmatt for adding this problem and creating all test cases.思路( Sieve of Erat原创 2017-02-12 23:05:15 · 228 阅读 · 0 评论 -
[LeedCode] Single Number II
Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you i原创 2017-03-06 10:06:30 · 221 阅读 · 0 评论 -
[LeedCode]Find the Duplicate Number/Linked List Cycle II
看到别人一个时间复杂度为O(n)的解法,觉得很有意思。记录一下。题目: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that th原创 2017-03-03 18:55:57 · 281 阅读 · 0 评论 -
[LeetCode]Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person.+----+---------+ | Id | Email | +----+---------+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +----+---------+For example,原创 2017-08-16 20:13:48 · 232 阅读 · 0 评论 -
[LeetCode]Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element always原创 2017-08-17 09:20:58 · 219 阅读 · 0 评论 -
[leetcode]367. Valid Perfect Square
/**************************************************************************** * Given a positive integer num, write a function which returns True if num is a perfect square else False. * * Note:原创 2017-09-13 23:07:10 · 225 阅读 · 0 评论