mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-04 08:50:41 +08:00
Enable ruff PGH003 rule (#11345)
* Enable ruff PGH003 rule * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -116,7 +116,9 @@ def spiral_traversal(matrix: list[list]) -> list[int]:
|
||||
[1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7] + spiral_traversal([])
|
||||
"""
|
||||
if matrix:
|
||||
return list(matrix.pop(0)) + spiral_traversal(list(zip(*matrix))[::-1]) # type: ignore
|
||||
return list(matrix.pop(0)) + spiral_traversal(
|
||||
[list(row) for row in zip(*matrix)][::-1]
|
||||
)
|
||||
else:
|
||||
return []
|
||||
|
||||
|
@ -12,7 +12,7 @@ import logging
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import pytest # type: ignore
|
||||
import pytest
|
||||
|
||||
# Custom/local libraries
|
||||
from matrix import matrix_operation as matop
|
||||
|
Reference in New Issue
Block a user