title: What is the fastest way to return x,y coordinates that are present in both list A and list B?
body: <p>I have two lists (list A and list B) of x,y coordinates where 0 &lt; x &lt; 4000, 0 &lt; y &lt; 4000, and they will always be integers. I need to know what coordinates are in both lists. What would be your suggestion for how to approach this?</p>
  
  <p>I have been thinking about representing the lists as two grids of bits and doing bitwise &amp; possibly?</p>
  
  <p>List A has about 1000 entries and changes maybe once every 10,000 requests. List B will vary wildly in length and will be different on every run through. </p>
  
  <p>EDIT: I should mention that no coordinate will be in lists twice; 1,1 cannot be in list A more than once for example.</p>