摘要:
Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n 阅读全文
posted @ 2017-10-20 21:00
daniel456
阅读(123)
评论(0)
推荐(0)
摘要:
You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number 阅读全文
posted @ 2017-10-20 20:53
daniel456
阅读(206)
评论(0)
推荐(0)
摘要:
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 求两个字符串的加法 阅读全文
posted @ 2017-10-20 20:42
daniel456
阅读(105)
评论(0)
推荐(0)
摘要:
Given a positive integer num, write a function which returns True if num is a perfect square else False. 题目含义:判断一个数能否被开方 阅读全文
posted @ 2017-10-20 20:39
daniel456
阅读(89)
评论(0)
推荐(0)
摘要:
Given an integer, write a function to determine if it is a power of three. 题目含义:给定一个数,判断它是否是3的n次方 思路:使用换底公式 阅读全文
posted @ 2017-10-20 20:36
daniel456
阅读(121)
评论(0)
推荐(0)
摘要:
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: 阅读全文
posted @ 2017-10-20 20:31
daniel456
阅读(95)
评论(0)
推荐(0)
摘要:
Given an integer, write a function to determine if it is a power of two. 题目含义:判断一个数是否是2的n次方 阅读全文
posted @ 2017-10-20 20:28
daniel456
阅读(127)
评论(0)
推荐(0)
摘要:
ount the number of prime numbers less than a non-negative number, n. 题目含义:要求计算小于N的所有素数的个数。素数又称质数,是只能被1和自身整数的数 思路:厄拉多塞筛法 西元前250年,希腊数学家厄拉多塞(Eeatosthese) 阅读全文
posted @ 2017-10-20 20:25
daniel456
阅读(110)
评论(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
阅读(169)
评论(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
阅读(99)
评论(0)
推荐(0)

浙公网安备 33010602011771号