function kWayUnionUniqueArrays(arrays) {
  var max = -Infinity,
      al,
      i,
      l;

  var filtered = [];

  for (i = 0, l = arrays.length; i < l; i++) {
    al = arrays[i].length;

    if (al === 0)
      continue;

    filtered.push(arrays[i]);

    if (al > max)
      max = al;
  }

  if (filtered.length === 0)
    return new arrays[0].constructor(0);

  if (filtered.length === 1)
    return filtered[0].slice();

  if (filtered.length === 2)
    return unionUniqueArrays(filtered[0], filtered[1]);

  arrays = filtered;

  var array = new arrays[0].constructor();

  var PointerArray = typed.getPointerArray(max);

  var pointers = new PointerArray(arrays.length);

  // TODO: benchmark vs. a binomial heap
  var heap = new FibonacciHeap(function(a, b) {
    a = arrays[a][pointers[a]];
    b = arrays[b][pointers[b]];

    if (a < b)
      return -1;

    if (a > b)
      return 1;

    return 0;
  });

  for (i = 0; i < l; i++)
    heap.push(i);

  var p,
      v;

  while (heap.size) {
    p = heap.pop();
    v = arrays[p][pointers[p]++];

    if (array.length === 0 || array[array.length - 1] !== v)
      array.push(v);

    if (pointers[p] < arrays[p].length)
      heap.push(p);
  }

  return array;
}
Perform the union of k sorted unique array-like structures into one.

@param  {array<array>} arrays - Arrays to merge.
@return {array}