Skip to content

Commit 5d6c8f5

Browse files
authored
Update Solution.py
1 parent ce5aac3 commit 5d6c8f5

File tree

1 file changed

+3
-3
lines changed
  • Algorithms/Easy/26_RemoveDuplicatesFromSortedArray

1 file changed

+3
-3
lines changed

Algorithms/Easy/26_RemoveDuplicatesFromSortedArray/Solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ def removeDuplicates(self, nums: List[int]) -> int:
55
# otherwise go forward
66

77
i = 1
8-
while i<len(nums):
9-
if nums[i-1] == nums[i]:
10-
nums.pop(i-1)
8+
while i < len(nums):
9+
if nums[i - 1] == nums[i]:
10+
nums.pop(i - 1)
1111
else:
1212
i += 1
1313

0 commit comments

Comments
 (0)