Fork me on GitHub
摘要: 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 exam 阅读全文
posted @ 2017-05-19 22:55 hellowOOOrld 阅读(88) 评论(0) 推荐(0)
摘要: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit 阅读全文
posted @ 2017-05-19 22:37 hellowOOOrld 阅读(133) 评论(0) 推荐(0)
摘要: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2 3 / / \ 4 5 阅读全文
posted @ 2017-05-19 15:13 hellowOOOrld 阅读(159) 评论(0) 推荐(0)
摘要: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2017-05-19 10:46 hellowOOOrld 阅读(175) 评论(0) 推荐(0)