-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
# 0603周报 | ||
## 一、学习记录 | ||
1. 学习了git的基本概念以及基本操作指令 | ||
1. 通过视频学习了解了互联网岗位的职责和关系 | ||
2. 了解分析了前后端开发的差异 | ||
3. 学习了git的基本概念以及基本操作指令 | ||
4. 学习了如何使用idea处理git | ||
5. leetcode刷题练习(题目来源:力扣面试150题) | ||
|
||
## 二、刷题 删除有序数组中的重复项II | ||
本题比较常规,我是用cnt下标计数器与之前比对,若是遇到重复的则跳过,直到不等时再更新nums中符合条件的下一位数 | ||
#### 我的代码 | ||
```java | ||
class Solution { | ||
public int removeDuplicates(int[] nums) { | ||
int n=nums.length,cnt=2,i; | ||
if(n<3) | ||
return n; | ||
for(i=2;i<n;i++) | ||
{ | ||
while(nums[i]==nums[cnt-2]) | ||
{ | ||
i++; | ||
if(i>n-1) | ||
return cnt; | ||
} | ||
nums[cnt++]=nums[i]; | ||
}return cnt; | ||
} | ||
}; | ||
``` |