We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 113fec1 commit 0db5354Copy full SHA for 0db5354
src/main/java/com/fishercoder/solutions/_189.java
@@ -80,11 +80,11 @@ public static void rotate(int[] nums, int k) {
80
81
public static class Solution3 {
82
public void rotate(int[] nums, int k) {
83
- int tmp = 0;
+ int tmp;
84
for (int i = 0; i < k; i++) {
85
tmp = nums[nums.length - 1];
86
for (int j = nums.length - 1; j > 0; j--) {
87
- nums[j] = nums[j-1];
+ nums[j] = nums[j - 1];
88
}
89
nums[0] = tmp;
90
0 commit comments