class Solution:
def power(self, matrix: List[List[int]]) -> List[int]:
if not matrix : return []
res = []
while matrix:
res.extend(matrix.pop(0))
next_matrix = []
for x in zip(*matrix):
next_matrix.append(x)
matrix = next_matrix[::-1]
return res
matrix = [[1,2,3],[4,5,6],[7,8,9]]
Solusion().power(matrix)
print(Solusion().power(matrix))
感謝大神
uj5u.com熱心網友回復:
from typing import List轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/86629.html
上一篇:python pip包到一半出現WinError進行不下去了T-T,99孩子
下一篇:Anaconda萌新求助
