Tag: C/C++
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same …
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. For example, given two integers x=1 and y=4, the hamming distance …
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 integer ’11′ …
For example, if you want to remove a bit or some bits from a integer (signed or unsigned), you can do this. inline int removeBit(int n, int bit) { …
This puzzle is from Leetcode Online Judge and this may appear quite often during interviews. This puzzle asks you to find the minimal sum for a number triangle. You …