题目链接

【题解】

沙比提

【代码】

class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if (nums.empty()) return 0;
int idx = 0;
int len = nums.size();
for (int i = 1;i < len;i++)
if (nums[i]!=nums[i-1]){
nums[++idx] = nums[i];
}
return idx+1;
}
};

最新文章

  1. 64位下pwntools中dynELF函数的使用
  2. Linq 单表城市级联
  3. 根据 MySQL 状态优化 ---- 4. 临时表
  4. selenium support
  5. Python基础4:数据类型:数字 字符串 日期
  6. 基于zepto判断mobile的横竖屏状态
  7. Bootstrap的clearfix
  8. vim MiniBufExplorer 插件
  9. 使用WeCloud消息推送接口发送消息NodeJs版
  10. 用PetaPoco为ASP.NET已有数据库建模
  11. [jzoj]3456.【NOIP2013模拟联考3】恭介的法则(rule)
  12. springboot学习一:快速搭建springboot项目
  13. struts2框架学习之第一天
  14. ZC_C++类函数指针_模拟_Delphi类函数指针
  15. VirtualBox 快捷键
  16. 解决securecrt连接centos使用VIM编辑中文时乱码
  17. 2014-2015 ACM-ICPC, NEERC, Eastern Subregional Contest Problem G. The Debut Album
  18. LightOJ - 1297 Largest Box LightOJ(一元三次方程求极大值)
  19. RabbitMQ 命令
  20. 【转】hexo博客图片问题

热门文章

  1. 根据mysql数据库 定义solr Schema.xml中配置业务域
  2. API登录验证
  3. djangorestframework-jwt 分页器 三种
  4. UVa 548 Tree (建树+前序后序)
  5. Linux 下安装配置redis
  6. TextView详解
  7. jetson资料
  8. PHP CURL或file_get_contents获取网页标题的代码及两者效率的稳定性问题
  9. angularjs的select使用2
  10. C++11中vector的几种遍历方法