You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/g0001_0100/s0026_remove_duplicates_from_sorted_array/readme.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,15 @@ The first `k` elements of `nums` should contain the unique numbers in **sorted o
12
12
13
13
The judge will test your solution with the following code:
14
14
15
-
int[] nums = [...]; // Input array int[] expectedNums = [...]; // The expected answer with correct length int k = removeDuplicates(nums); // Calls your implementation assert k == expectedNums.length; for (int i = 0; i < k; i++) { assert nums[i] == expectedNums[i]; }
15
+
int[] nums = [...]; // Input array
16
+
int[] expectedNums = [...]; // The expected answer with correct length
17
+
18
+
int k = removeDuplicates(nums); // Calls your implementation
19
+
20
+
assert k == expectedNums.length;
21
+
for (int i = 0; i < k; i++) {
22
+
assert nums[i] == expectedNums[i];
23
+
}
16
24
17
25
If all assertions pass, then your solution will be **accepted**.
18
26
@@ -36,4 +44,4 @@ If all assertions pass, then your solution will be **accepted**.
0 commit comments