```ts
export function gridFlip(grid: number[][]): number[][] {
  if (!grid.length) return []; // Handle empty input

  const flippedGrid = grid[0].map((_, colIndex) => grid.map(row => row[colIndex]));

  return flippedGrid;
}
```