Monday, November 15, 2021

Some Basic Bit Manipulation Problems with hints

 461. Hamming Distance  (Try to figure out XOR and set bit Count)
136. Single Number (Two same numbers XOR is 0, means a^a = 0)
268. Missing Number (Same as before, a^b^b = a. It can be also solved by using binary search, Think)
191. Number of 1 Bits (Count number of set bit(1))
231. Power of Two (Think using bit manipulation and without bit manipulation, solve using both cases)
342Power of Four (Same as before, think about both cases)
78. Subsets (Each subset can be represented as a single bit)
1720. Decode XORed Array (Read the problem statement carefully)
1486. XOR Operation in an Array 
(Read the problem statement carefully)
1863. Sum of All Subset XOR Totals (Simple backtracking)
371. Sum of Two Integers (Think about carry of two values and sum with recursively)



No comments:

Post a Comment