26. Remove Duplicates from Sorted Array徒手尝试#1(Done)
来源:互联网 发布:编程小白学 python 编辑:程序博客网 时间:2024/06/17 00:02
Solution
public class Solution { public int removeDuplicates(int[] nums) { if(nums == null || nums.length == 0) return 0; if(nums.length == 1) return 1; int n = nums[0]; int len = 1; for(int i = 1; i < nums.length; i++) { if(n != nums[i]) { n = nums[i]; nums[len++] = n; } } return len; }}
Problem
0 0
- 26. Remove Duplicates from Sorted Array徒手尝试#1(Done)
- [LeetCode]26.Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array
- LeetCode 26. Remove Duplicates from Sorted Array
- LeetCode --- 26. Remove Duplicates from Sorted Array
- LeetCode 26.Remove Duplicates from Sorted Array
- [Leetcode] 26. Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array
- 【leetcode】26. Remove Duplicates from Sorted Array
- 【leetcode】 26. Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array
- [leetCode]26. Remove Duplicates from Sorted Array
- LeetCode 26.Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array LeetCode
- 26. Remove Duplicates from Sorted Array
- 26. Remove Duplicates from Sorted Array
- android开发 -- 时间控件的使用
- Android-Resources-Hodgepodge(Android资源大杂烩)
- java 对象转成另一个对象
- 响应式菜单
- 深度探索c++对象模型之临时对象的传说
- 26. Remove Duplicates from Sorted Array徒手尝试#1(Done)
- java线程内存模型,线程、工作内存、主内存
- 大数据Web日志分析 用Hadoop统计KPI指标实例
- 分页, 上拉刷新、下拉加载。
- DNS基础知识体系和DNS架构
- 计算机科学与技术专业课程
- JAVA/Android中代码规范!
- Quartz2D绘制饼图
- 9.3浮点数四舍五入