• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2014年10月10日
Leetcode: Simplify Path
摘要: Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" 难度:85,虽然不难,但是里 阅读全文
posted @ 2014-10-10 13:20 neverlandly 阅读(339) 评论(0) 推荐(0)
Leetcode: Max Points on a line
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.Brute Force的做法,N个点两两可以构成N(N-1)/2条线,我们可以找这N(N-1)/2条线... 阅读全文
posted @ 2014-10-10 08:32 neverlandly 阅读(412) 评论(0) 推荐(0)
Leetcode: Surrounded Regions
摘要: 难度:92。这个题目用到的方法是图形学中的一个常用方法:Flood fill算法,其实就是从一个点出发对周围区域进行目标颜色的填充。背后的思想就是把一个矩阵看成一个图的结构,每个点看成结点,而边则是他上下左右的相邻点,然后进行一次广度或者深度优先搜索。 这道题首先四个边缘上的‘O’点都不是被surr 阅读全文
posted @ 2014-10-10 04:01 neverlandly 阅读(557) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3