随笔分类 -  Numbers & Digits

摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div 阅读全文
posted @ 2016-07-13 22:39 北叶青藤 阅读(167) 评论(0) 推荐(0)
摘要:Implement pow(x, n). Notice You don't need to care about the precision of your answer, it's acceptable if the expected answer and your answer 's diffe 阅读全文
posted @ 2016-07-13 10:43 北叶青藤 阅读(186) 评论(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 integer, 阅读全文
posted @ 2016-07-12 06:49 北叶青藤 阅读(433) 评论(0) 推荐(0)
摘要:Implement int sqrt(int x). Compute and return the square root of x. Have you met this question in a real interview? Yes Example sqrt(3) = 1 sqrt(4) = 阅读全文
posted @ 2016-07-10 12:29 北叶青藤 阅读(203) 评论(0) 推荐(0)
摘要:Ugly Number Write a program to check whether a given number is an ugly number`. Ugly numbers are positive numbers whose prime factors only include 2,  阅读全文
posted @ 2016-07-06 04:12 北叶青藤 阅读(333) 评论(0) 推荐(0)
摘要:Count the number of k's between 0 and n. k can be 0 - 9. Count the number of k's between 0 and n. k can be 0 - 9. Count the number of k's between 0 an 阅读全文
posted @ 2016-07-06 02:33 北叶青藤 阅读(406) 评论(0) 推荐(0)
摘要:Write an algorithm which computes the number of trailing zeros in n factorial. Have you met this question in a real interview? Yes Write an algorithm 阅读全文
posted @ 2016-07-06 02:16 北叶青藤 阅读(179) 评论(0) 推荐(0)