Skip to content

Commit efe6f98

Browse files
authored
Merge pull request gzc426#22 from codemongkey/master
句子
2 parents de26358 + 5699c12 commit efe6f98

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

2019.11.25-leetcode80/句子.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```
2+
public class FOR80 {
3+
public static int removeDuplicates(int[] nums) {
4+
if (nums.length < 3)
5+
return nums.length;
6+
int j = 2;
7+
int last = nums[1], d_last = nums[0];
8+
for (int i = 2; i < nums.length; ++i) {
9+
if (d_last == last && d_last == nums[i])
10+
continue;
11+
nums[j++]=nums[i];
12+
d_last=last;
13+
last=nums[0];
14+
}
15+
return j;
16+
}
17+
public static void main(String[] args) {
18+
19+
}
20+
}
21+
```

0 commit comments

Comments
 (0)