NVIDIA Interview Question

Given a 32 bit unsigned integer, write a function (in C) that returns a count of how many bits are "1".

Interview Answer

Anonymous

Oct 4, 2015

leetcode question: number of 1 bits. To optimize, you need something like n = n & (n-1)