![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
sjtubn
这个作者很懒,什么都没留下…
展开
-
[LeetCode][C#]Number of 1 Bits
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: Input: 00000000000000000000000000001011 Output: 3 Explanat...原创 2019-02-18 16:37:39 · 151 阅读 · 0 评论 -
[LeetCode][C#]Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example 1: Input: 16 Output: true Example 2: Input: 5 Output: false 思路:从1开始依次乘以4,直到超过给定的值,即可判断。 注意:乘4结...原创 2019-02-18 15:10:57 · 96 阅读 · 0 评论 -
[LeetCode][C#]Total Hamming Distance
The Hamming Distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total Hamming distance between all pairs of the given n...原创 2019-02-18 16:50:13 · 83 阅读 · 0 评论 -
[LeetCode][C#]Counting Bits
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 return them as an array. Example 1: Input: 2 Out...原创 2019-02-18 17:12:34 · 118 阅读 · 0 评论