code-chronicles-code / code-chronicles-code/leetcode-curriculum

Add a `transpose` Java goody

Open
#221 0 comments 0 reactions 0 assignees View on GitHub
enhancement java
Dominant language
TypeScript
Stars
20
Forks
12
PR merge metrics
No merged PRs in 30d

Description

I'm thinking it would be neat to make this "lazy", i.e. have it backed by the same data as the original.

A possible API:

```java
int[][] matrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
List> transposedMatrix = transpose(matrix);

System.out.println(transposedMatrix); // should print [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
```

The implementation could use the `VirtualList` goody to achieve this effect.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.