Problem, as an interviewer would state it:
"Implement unzip(zipped) — the genuine inverse of zip, taking a single array of grouped tuples and separating it back into multiple, parallel arrays."
Examples:
unzip([[1,"a"], [2,"b"], [3,"c"]]); // [[1,2,3], ["a","b","c"]]
Clarifying questions expected:
- Is this genuinely the exact inverse of zip — does unzip(zip(a, b)) need to reproduce [a, b] exactly?
- What if the tuples themselves have varying lengths — should the output account for the LONGEST tuple?
- What real, correct output should an empty input array produce?
Code / implementation expected: Yes — real, direct proof that this is the genuine inverse of zip, confirmed via a full round trip through both functions.