摘要: Given an integer, write a function to determine if it is a power of two. Example 1: Example 2: Example 3: 相关题 二进制中1的个数 LeetCode191 https://www.cnblogs 阅读全文
posted @ 2019-03-31 16:48 月半榨菜 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight). Example 1: Example 2: Exa 阅读全文
posted @ 2019-03-31 16:38 月半榨菜 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library functio 阅读全文
posted @ 2019-03-31 15:53 月半榨菜 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in 阅读全文
posted @ 2019-03-31 15:32 月半榨菜 阅读(133) 评论(0) 推荐(0) 编辑