• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2015年12月28日
Leetcode: Best Meeting Point
摘要: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h... 阅读全文
posted @ 2015-12-28 12:06 neverlandly 阅读(286) 评论(0) 推荐(0)
Leetcode: Find Median from Data Stream
摘要: 最大最小堆 复杂度 时间 O(logN) insert, O(1) query, 空间 O(N) 思路 维护一个最大堆,一个最小堆。最大堆存的是到目前为止较小的那一半数,最小堆存的是到目前为止较大的那一半数,这样中位数只有可能是堆顶或者堆顶两个数的均值。而维护两个堆的技巧在于判断堆顶数和新来的数的大 阅读全文
posted @ 2015-12-28 07:45 neverlandly 阅读(280) 评论(0) 推荐(0)
Leetcode: Flip Game II
摘要: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu 阅读全文
posted @ 2015-12-28 06:05 neverlandly 阅读(535) 评论(0) 推荐(0)
Leetcode: Flip Game
摘要: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu... 阅读全文
posted @ 2015-12-28 04:17 neverlandly 阅读(303) 评论(0) 推荐(0)
Leetcode: Nim Game
摘要: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston... 阅读全文
posted @ 2015-12-28 02:17 neverlandly 阅读(226) 评论(0) 推荐(0)
Leetcode: Word Pattern II
摘要: Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter... 阅读全文
posted @ 2015-12-28 01:45 neverlandly 阅读(342) 评论(0) 推荐(0)
Leetcode: Word Pattern
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2015-12-28 00:54 neverlandly 阅读(327) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3