export const transpose = (input) => {
const maxLen = Math.max(0, ...input.map(s => s.length));
return Array.from({ length: maxLen }, (_, i) =>
input
.map((s, j) => s[i] || (input.slice(j + 1).some(next => next.length > i) ? ' ' : ''))
.join('')
);
};