Frage im Vorstellungsgespräch bei Apple

Count bits set in a byte

Antwort im Vorstellungsgespräch

Anonym

24. Juni 2019

int count = 0; while(n) { n &= (n-1); count++; } return count;

1