Google Interview Question

Merge n sorted arrays using an integer stream as the output.