Junior — Senior
Merging multiple channels into a single stream
livecode
Task condition
It is required to write a function that takes an arbitrary number of input channels and merges the data received from them into a single common output channel. The function should correctly handle the closing of input channels and terminate after all sources are exhausted, passing the received elements to the resulting channel.