• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2015年12月27日
Leetcode: Game of Life
摘要: 编解码法 复杂度 时间 O(NN) 空间 O(1) 思路 最简单的方法是再建一个矩阵保存,不过当inplace解时,如果我们直接根据每个点周围的存活数量来修改当前值,由于矩阵是顺序遍历的,这样会影响到下一个点的计算。如何在修改值的同时又保证下一个点的计算不会被影响呢?实际上我们只要将值稍作编码就行了 阅读全文
posted @ 2015-12-27 13:18 neverlandly 阅读(502) 评论(0) 推荐(0)
Leetcode: Alien Dictionary && Summary: Topological Sort
摘要: There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the... 阅读全文
posted @ 2015-12-27 12:05 neverlandly 阅读(573) 评论(0) 推荐(0)
Leetcode: Unique Word Abbreviation
摘要: An abbreviation of a word follows the form . Below are some examples of word abbreviations:a) it --> it (no abbreviation) ... 阅读全文
posted @ 2015-12-27 07:14 neverlandly 阅读(382) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3