随笔分类 -  leetcode_math

摘要:ount the number of prime numbers less than a non-negative number, n. 题目含义:要求计算小于N的所有素数的个数。素数又称质数,是只能被1和自身整数的数 思路:厄拉多塞筛法 西元前250年,希腊数学家厄拉多塞(Eeatosthese) 阅读全文
posted @ 2017-10-20 20:25 daniel456 阅读(107) 评论(0) 推荐(0) 编辑
摘要:Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2017-10-20 20:14 daniel456 阅读(163) 评论(0) 推荐(0) 编辑
摘要:Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 题目含义:这里我们要求n!末尾有多少个0 思路: 阅读全文
posted @ 2017-10-20 19:49 daniel456 阅读(93) 评论(0) 推荐(0) 编辑
摘要:Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: 阅读全文
posted @ 2017-10-20 19:45 daniel456 阅读(112) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 阅读全文
posted @ 2017-10-20 19:43 daniel456 阅读(146) 评论(0) 推荐(0) 编辑
摘要:Implement int sqrt(int x). Compute and return the square root of x. 题目题目:返回一个int数开方后的结果 阅读全文
posted @ 2017-10-20 19:40 daniel456 阅读(110) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-10-20 19:34 daniel456 阅读(127) 评论(0) 推荐(0) 编辑
摘要:Determine whether an integer is a palindrome. Do this without extra space. 题目含义:不要使用额外空间,判断整数是否为回文 阅读全文
posted @ 2017-10-20 19:32 daniel456 阅读(90) 评论(0) 推荐(0) 编辑
摘要:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 题目含义翻转一个整数 相关题目:190. Reverse Bits 阅读全文
posted @ 2017-10-20 16:08 daniel456 阅读(87) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-10-20 11:05 daniel456 阅读(130) 评论(0) 推荐(0) 编辑
摘要:A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2017-10-19 20:11 daniel456 阅读(179) 评论(0) 推荐(0) 编辑
摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should be the 阅读全文
posted @ 2017-10-19 19:26 daniel456 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2017-10-19 18:13 daniel456 阅读(115) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, 阅读全文
posted @ 2017-10-19 15:20 daniel456 阅读(107) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2017-10-19 11:48 daniel456 阅读(114) 评论(0) 推荐(0) 编辑
摘要:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2017-10-19 11:40 daniel456 阅读(146) 评论(0) 推荐(0) 编辑
摘要:Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 题目含义:将两个字符串进行二进制加减法。 思路:从最后一位开始依次计算,注意进位 阅读全文
posted @ 2017-10-16 21:46 daniel456 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 求三个乘积最大,注意下负数的情况,两负*一正 阅读全文
posted @ 2017-10-15 11:07 daniel456 阅读(93) 评论(0) 推荐(0) 编辑
摘要:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 阅读全文
posted @ 2017-10-15 08:41 daniel456 阅读(131) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示