Update and rename array-remove-duplicate-inplace.py to remove_dups_inplace.py

This commit is contained in:
marina 2023-08-07 17:26:48 -07:00 committed by GitHub
parent 2f1db3f84e
commit b81ccd579b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
# author: bt3gl
### Remove Duplicates from Sorted Array in-place
def remove_duplicates(nums: list[int]) -> int:
@ -23,10 +22,3 @@ def remove_duplicates(nums: list[int]) -> int:
return dup_i - arr_i - 1, nums
if __name__ == "__main__":
nums = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4]
assert(remove_duplicates(nums) == (5, [0, 1, 2, 3, 4, '_', '_', '_', '_', '_']))