• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






struggleforit

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2016年12月3日

Array Two(2)
摘要: (3)Remove Duplicates from Sorted Array 最优解代码如下:【注意最标准的代码风格!!!】 1 public class Solution { 2 public int removeDuplicates(int[] nums) { 3 if (nums == nul 阅读全文
posted @ 2016-12-03 21:25 struggleforit 阅读(109) 评论(0) 推荐(0)
 
Array Two
摘要: Come on,baby~ (1)Contains Duplicate 有自己的思路:两个for双重循环直接一个个比较,但肯定不是最优解。所以,使用Set中的HashSet(一种没有重复元素的无序集合),最优解如下: HashSet百度链接:http://baike.baidu.com/link?u 阅读全文
posted @ 2016-12-03 20:18 struggleforit 阅读(147) 评论(0) 推荐(0)