일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 쓰릴오브파이트
- leetcode
- 괜찮음
- 사이드
- 리얼 클래스
- 스탭퍼
- 매일
- realclass
- 3줄정리
- 운동
- 뭐든
- 파비최
- English
- FIT XR
- 화상영어
- 영어원서읽기
- 개발자
- 읽기
- 미드시청
- 프로젝트
- 잡생각
- 10분
- 영어공부
- Problem Solving
- Daily Challenge
- 30분
- 만화도
- Writing
- 링피트
- 월간
Archives
- Today
- Total
파비의 매일매일 공부기록
2023.12.12 Today's Challenge 본문
https://leetcode.com/problems/transpose-matrix/?envType=daily-question&envId=2023-12-10
Transpose Matrix - LeetCode
Can you solve this real interview question? Transpose Matrix - Given a 2D integer array matrix, return the transpose of matrix. The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices. [https://
leetcode.com
행렬을 변환하는 매우 간단한 문제
class Solution:
def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
res = []
for i in range(len(matrix[0])):
temp = []
for j in range(len(matrix)):
temp.append(matrix[j][i])
res.append(temp)
return res
반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
2023.12.14 Today's Challenge (0) | 2023.12.14 |
---|---|
2023.12.13 Today's Challenge (0) | 2023.12.13 |
2023.12.11 Today's Challenge (0) | 2023.12.11 |
2023.12.10 Today's Challenge (0) | 2023.12.10 |
2023.12.09 Today's Challenge (0) | 2023.12.09 |
Comments