Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4fff0ea

Browse files
author
wuyudi
authored
add 48
1 parent 27ec881 commit 4fff0ea

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,17 @@ class Solution:
497497
from itertools import permutations
498498
return list(permutations(nums))
499499
```
500+
## [48. rotate-image 1行](https://leetcode.com/problems/rotate-image/)
501+
先转置后镜像对称
502+
```python
503+
class Solution:
504+
def rotate(self, matrix: List[List[int]]) -> None:
505+
"""
506+
Do not return anything, modify matrix in-place instead.
507+
"""
508+
matrix[:] = [i[::-1] for i in zip(*matrix)]
509+
```
510+
[:] 才会修改原列表
500511
## [49. Group Anagrams 1行](https://leetcode.com/problems/group-anagrams/)
501512
```python
502513
class Solution:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /