摘要:
Given a positive integer num, write a function which returns True if num is a perfect square else False. 题目含义:判断一个数能否被开方 阅读全文
摘要:
Given an integer, write a function to determine if it is a power of three. 题目含义:给定一个数,判断它是否是3的n次方 思路:使用换底公式 阅读全文
摘要:
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: 阅读全文
摘要:
Given an integer, write a function to determine if it is a power of two. 题目含义:判断一个数是否是2的n次方 阅读全文
摘要:
ount the number of prime numbers less than a non-negative number, n. 题目含义:要求计算小于N的所有素数的个数。素数又称质数,是只能被1和自身整数的数 思路:厄拉多塞筛法 西元前250年,希腊数学家厄拉多塞(Eeatosthese) 阅读全文
摘要:
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 阅读全文
摘要:
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 题目含义:这里我们要求n!末尾有多少个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: 阅读全文
摘要:
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 阅读全文
摘要:
Implement int sqrt(int x). Compute and return the square root of x. 题目题目:返回一个int数开方后的结果 阅读全文