Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f1243fd

Browse files
fix 26
1 parent 33b135d commit f1243fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/solution/s0026_remove_duplicates_from_sorted_array.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
*/
4646
pub struct Solution {}
4747

48-
// problem: https://leetcode.com/problems/remove-duplicates-from-sorted-array/
49-
// discuss: https://leetcode.com/problems/remove-duplicates-from-sorted-array/discuss/?currentPage=1&orderBy=most_votes&query=
50-
48+
// problem: https://leetcode.com/problems/remove-duplicates-from-sorted-array/
49+
// discuss: https://leetcode.com/problems/remove-duplicates-from-sorted-array/discuss/?currentPage=1&orderBy=most_votes&query=
50+
5151
// submission codes start here
5252

5353
impl Solution {
@@ -63,6 +63,7 @@ impl Solution {
6363
nums[slow] = nums[fast];
6464
}
6565
}
66+
nums.truncate(slow + 1);
6667
(slow + 1) as i32
6768
}
6869
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /