FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ProjectAlgorithms/codes/java/RotateImage.java at main · Sayakb03/ProjectAlgorithms · GitHub
Sayakb03
/
ProjectAlgorithms
Public
forked from
Google-DSC-TMSL/ProjectAlgorithms
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ProjectAlgorithms
/
codes
/
java
/
RotateImage.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (14 loc) · 491 Bytes
Breadcrumbs
ProjectAlgorithms
/
codes
/
java
/
RotateImage.java
Copy path
File metadata and controls
14 lines (14 loc) · 491 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class
Solution
{
public
void
rotate
(
int
[][]
matrix
) {
int
n
=
matrix
.
length
;
for
(
int
i
=
0
;
i
< (
n
+
1
) /
2
;
i
++) {
for
(
int
j
=
0
;
j
<
n
/
2
;
j
++) {
int
temp
=
matrix
[
n
-
1
-
j
][
i
];
matrix
[
n
-
1
-
j
][
i
] =
matrix
[
n
-
1
-
i
][
n
-
j
-
1
];
matrix
[
n
-
1
-
i
][
n
-
j
-
1
] =
matrix
[
j
][
n
-
1
-
i
];
matrix
[
j
][
n
-
1
-
i
] =
matrix
[
i
][
j
];
matrix
[
i
][
j
] =
temp
;
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL