sayicheng

Results 3 comments of sayicheng

```py class Solution: def __init__(self): successor = None def reverseN(self, head: ListNode, n: int) -> ListNode: if (n == 1): self.successor = head.next return head last = self.reverseN(head.next, n -...

48题 顺时针旋转90度:先水平翻转,然后主对角线翻转。 ```py class Solution: def rotate(self, matrix: List[List[int]]) -> None: n = len(matrix[0]) if n == 1: return """solution2""" """水平翻转""" for i in range(n//2): matrix[i], matrix[n-i-1] = matrix[n-i-1], matrix[i]...

48题 顺时针旋转90度:先水平翻转,然后主对角线翻转。 ```py class Solution: def rotate(self, matrix: List[List[int]]) -> None: n = len(matrix[0]) if n == 1: return """solution2""" """水平翻转""" for i in range(n//2): matrix[i], matrix[n-i-1] = matrix[n-i-1], matrix[i]...