随笔分类 - Numbers & Digits
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div
阅读全文
摘要: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
阅读全文
摘要: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,
阅读全文
摘要: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) =
阅读全文
摘要: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,
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号