Skip to content

Commit

Permalink
Update Rotate90.java
Browse files Browse the repository at this point in the history
rectified a small error as I had declared the temp variable at the wrong place due to which it was out of block scope .
  • Loading branch information
BlazePhenom authored and x0lg0n committed Nov 1, 2024
1 parent 8d47aac commit 9a76e6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Java/Rotate90.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
public class Rotate90 {
public void solve(int[][] A) {
int temp;
for(int i = 0; i<A.length; i++){
for(int j = i+1; j<A.length; j++){
int temp = A[i][j]; //the temp variable has been declared to do the swapping process
temp = A[i][j]; //the temp variable has been declared to do the swapping process
A[i][j] = A[j][i];
A[j][i] = temp;
}
Expand Down

0 comments on commit 9a76e6d

Please sign in to comment.