• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2014年9月6日
Leetcode: Subsets II
摘要: 第二遍Better做法: 第11行 i>start && nums[i]==nums[i-1] 就skip很不错 第一遍做法:需要已访问数组,当前后元素一样且前面元素并未访问,这个时候就是重复的case, continue, 注意这里的判重复条件跟3Sum那种是不一样的, 3SUM防止重复方法是 i 阅读全文
posted @ 2014-09-06 07:11 neverlandly 阅读(505) 评论(0) 推荐(0)
Leetcode: Unique Paths II
摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
posted @ 2014-09-06 05:22 neverlandly 阅读(476) 评论(0) 推荐(0)
Leetcode: Minimum Path Sum
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2014-09-06 04:24 neverlandly 阅读(478) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3