Skip to content

Commit 8c46d9c

Browse files
committed
Day60
1 parent 30ee08a commit 8c46d9c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Day60/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var removeDuplicates = function (nums) {
6+
7+
for (let i = 0; i < nums.length; i++) {
8+
9+
if (nums[i] == nums[i + 1]) {
10+
11+
i++;
12+
13+
while (nums[i] == nums[i + 1]) {
14+
nums.splice(i + 1, 1)
15+
}
16+
}
17+
}
18+
};

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,6 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to
135135

136136
|Day 58| [117. Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/) | [javascript]()|[:memo:](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/)|Medium|
137137

138-
|Day 59| [1. Two Sum](https://leetcode.com/problems/two-sum/) | [javascript]()|[:memo:](https://leetcode.com/problems/two-sum/)|Easy|
138+
|Day 59| [1. Two Sum](https://leetcode.com/problems/two-sum/) | [javascript]()|[:memo:](https://leetcode.com/problems/two-sum/)|Easy|
139+
140+
|Day 60| [80. Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [javascript]()|[:memo:](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)|Medium|

0 commit comments

Comments
 (0)