title: Efficient way of computing running count of "how many x less than y?" in KDB
body: <p>I have 2 sorted lists <code>x</code> and <code>y</code> and I want to find a running count of how many <code>x</code> are less than <code>y</code>. The following works for now:</p>
  
  <pre><code>x:10*til 3;   / 0 10 20
  y:til 30;     / 0 1 2 ... 30
  sum {x &lt; y}[;y] each x
  q) 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3
  </code></pre>
  
  <p>but I suspect using <code>each</code> isn't the most efficient way of doing things. Considering my <code>x</code>,<code>y</code> may end up being in the order of tens of millions of items, is there a faster way? </p>