Pinned Loading
-
Power of Four - LeetCode - Day 19
Power of Four - LeetCode - Day 19 1[Question](https://leetcode.com/problems/power-of-four/description)
23# Intuition4Building off [my bit-manipulation solution to the power of two problem](https://gist.github.com/PeculiarE/067b1c1be7fb614a16505a6a0f6e5c75), I knew that powers of 4 would only have one 1-bit. This is because a power of 4 is also a power of 2, and since the latter has only one 1-bit, then the same rule applies to the former.
5 -
Hamming Distance - LeetCode - Day 20
Hamming Distance - LeetCode - Day 20 1[Question](https://leetcode.com/problems/hamming-distance/description)
23# Intuition4The bitwise XOR operator (^) always returns a 1 if two bits are different and 0 if they are the same.
5 -
Number Complement - LeetCode - Day 21
Number Complement - LeetCode - Day 21 1[Question](https://leetcode.com/problems/number-complement/description)
23# Intuition4First thoughts:
5- Because the probem states that leading zeros are not considered, simply flipping the bits using the NOT operator (~) won't work
-
Binary Number with Alternating Bits ...
Binary Number with Alternating Bits - LeetCode - Day 22 1[Question](https://leetcode.com/problems/binary-number-with-alternating-bits/description/?envType=problem-list-v2&envId=bit-manipulation)
23# Intuition4- When you AND (&) a bit with 1, you'll get the same bit (0 & 1 = 0; 1 & 1 = 1).5- When you XOR (^) a bit with itself, you'll always get 0. But if you XOR a bit with its opposite, you'll always get 1 -
Prime Number of Set Bits in Binary R...
Prime Number of Set Bits in Binary Representation - LeetCode - Day 23 1[Question](https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/description)
23# Intuition4Based on a previously solved problem ([Number of 1 Bits](https://gist.github.com/PeculiarE/6c4aa27d2805a7abab40e08894c069dc)), we already know how to count the number of 1-bits in a number. Now, we just have to do it for all the numbers in the provided range for this problem.
5 -
Binary Gap - LeetCode - Day 24
Binary Gap - LeetCode - Day 24 1[Question](https://leetcode.com/problems/binary-gap/description)
23# Intuition4We have to go to through each bit in the number and track the positions of the 1-bits and the distances between them.
5
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.



