Skip to content

Commit a65b4af

Browse files
authored
Merge pull request aylei#28 from TianyiShi2001/fix-26
fix 26
2 parents 33b135d + f1243fd commit a65b4af

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

+4-3
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)