kn0ppers's blog

By kn0ppers, history, 4 years ago, In English

Hi all,

recently i attended a job interview where i got the following question:

Given x and y, find the number of integers such that for z in [1..x] z & y > 0?

Is there a faster way to compute this other than iterating through all the ints from [1..x]? Is there some sort of trick to compute this directly? I appreciate anyone taking the time to give me hints/tricks to compute this.

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it