Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"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



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!


I get that but I am proposing to hard code the answer since I already know it


No no no, this is Google. You must start a MapReduce, or whatever replaced it these days.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: