Skip to content

Commit ba072a2

Browse files
committed
update
1 parent 80bc668 commit ba072a2

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Time: O(n ^ 2)
1+
# Time: O(n^2)
22
# Space: O(1)
33
#
44
# You are given an n x n 2D matrix representing an image.
@@ -9,7 +9,7 @@
99
# Could you do this in-place?
1010
#
1111

12-
# Time: O(n ^ 2)
12+
# Time: O(n^2)
1313
# Space: O(1)
1414
class Solution:
1515
# @param matrix, a list of lists of integers
@@ -29,8 +29,8 @@ def rotate(self, matrix):
2929

3030
return matrix
3131

32-
# Time: O(n ^ 2)
33-
# Space: O(n ^ 2)
32+
# Time: O(n^2)
33+
# Space: O(n^2)
3434
class Solution2:
3535
# @param matrix, a list of lists of integers
3636
# @return a list of lists of integers
@@ -39,4 +39,4 @@ def rotate(self, matrix):
3939

4040
if __name__ == "__main__":
4141
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
42-
print Solution().rotate(matrix)
42+
print Solution().rotate(matrix)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Problem | Solution | Time | Space | Difficul
5656
[Remove Duplicates from Sorted Array]| [remove-duplicates-from-sorted-array.py] | _O(n)_ | _O(1)_ | Easy |
5757
[Remove Duplicates from Sorted Array II]| [remove-duplicates-from-sorted-array-ii.py] | _O(n)_ | _O(1)_ | Medium |
5858
[Remove Element] | [remove-element.py] | _O(n)_ | _O(1)_ | Easy |
59+
[Rotate Image] | [rotate-image.py] | _O(n^2)_ | _O(1)_ | Medium |
5960

6061
[3 Sum]: https://oj.leetcode.com/problems/3sum/
6162
[3sum.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/3sum.py
@@ -83,7 +84,8 @@ Problem | Solution | Time | Space | Difficul
8384
[remove-duplicates-from-sorted-array-ii.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/remove-duplicates-from-sorted-array-ii.py
8485
[Remove Element]:https://oj.leetcode.com/problems/remove-element/
8586
[remove-element.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/remove-element.py
86-
87+
[Rotate Image]:https://oj.leetcode.com/problems/rotate-image/
88+
[rotate-image.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/rotate-image.py
8789

8890
---
8991

0 commit comments

Comments
 (0)