update project structure

This commit is contained in:
2024-06-20 06:29:07 +08:00
parent 17b4ef8970
commit fdaa94a0fa
49 changed files with 35 additions and 4 deletions

16
leetcode_py/26.py Normal file
View File

@@ -0,0 +1,16 @@
# Remove Duplicates from Sorted Array
# -100 <= nums[i] <= 100
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
count = 0
if not nums:
return count
k = 1
for i in range(1, len(nums)):
if nums[i] != nums[i - 1]:
nums[k] = nums[i]
k += 1
return k