Remove Duplicates from Sorted Array II
来源:互联网 发布:网络机顶盒破解教程 编辑:程序博客网 时间:2024/06/06 10:42
class Solution {public: int removeDuplicates(vector<int>& nums) { const int n=nums.size(); if(0==n) return 0; int temp=nums[0]; int length=0; for(int i=1;i<n;++i) { if(nums[i]==temp) ++length; else { nums[i-length]=nums[i]; temp=nums[i]; } } return n-length; }};
0 0
- LeetCode: Remove Duplicates from Sorted Array II
- [Leetcode] Remove Duplicates from Sorted Array II
- LeetCode: Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- [Leetcode] Remove Duplicates from Sorted Array II
- [LeetCode] Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- [leetcode] Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- Remove duplicates from sorted array II
- Remove Duplicates from Sorted Array II
- [LeetCode]Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array II
- [leetcode]Remove Duplicates from Sorted Array II
- LeetCode-Remove Duplicates from Sorted Array II
- 如何提高数据库查询速度
- 指向结构体类型的指针强制转换为指向另外一种结构体类型。会不会出现问题?
- 会员卡管理系统技术解析(十七)库存年卡有效期变更
- POI--帮助文档
- java求职宝典
- Remove Duplicates from Sorted Array II
- 【转载】J2SE知识点归纳笔记(七)---Java IO Part 4:基本字符流
- 搭建基于CXF的WebService服务器,及其应用
- 梦入你的世界
- jdbc连接数据库的基本操作
- Git on ubuntu
- python文件拷贝
- 校验maven配置文件
- Java和Python使用有道词典制作查单词脚本