MediumPro challengePythonJavaScriptTypeScript

Stream Buffer Concatenation

Node.jsStreamsBuffers

Simulate consuming a readable stream that emits chunks (string arrays).
Return one concatenated string.

solve(['Hello, ', 'World', '!'])'Hello, World!'.

Sample tests

Test #1Three chunks
Input: [["Hello, ","World","!"]]
Output: "Hello, World!"
Test #2Empty stream
Input: [[]]
Output: ""
Test #3Single chunk
Input: [["single"]]
Output: "single"
Test #4Empty chunk in middle
Input: [["a","","b"]]
Output: "ab"
Test #5Three single chars
Input: [["x","y","z"]]
Output: "xyz"