←back to thread

1764 points fatihky | 4 comments | | HN request time: 1.355s | source
1. gmarx ◴[] No.12701853[source]
"There's an array of 10,000 16-bit values, how do you count the bits most efficiently?"

multiply 10,000 by 16. There are 160,000 bits

replies(2): >>12702224 #>>12702246 #
2. biocomputation ◴[] No.12702224[source]
My sarcastic reply is to your very reasonable answer is:

On the x86 architecture, integer multiplies take more cycles than a comparable solution that uses bit twiddling so you're just WRONG!

You are the weakest link, GOODBYE!

replies(1): >>12703467 #
3. yongjik ◴[] No.12702246[source]
No no no, this is Google. You must start a MapReduce, or whatever replaced it these days.
4. gmarx ◴[] No.12703467[source]
I get that but I am proposing to hard code the answer since I already know it