Skip to content

Bug Report for transpose-matrix #5425

@zoravur

Description

@zoravur

Bug Report for https://neetcode.io/problems/transpose-matrix

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

The function accepts List[List[int]], but the following passes:

class Solution:
    def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
        return list(zip(*matrix))

This solution actually turns each row in the new matrix into a tuple, which is not expected. Perhaps the return type of each sublist should be verified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions