• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ArgenBarbie
博客园    首页    新随笔    联系   管理    订阅  订阅
2016年8月25日
229. Majority Element II -- 找出数组中出现次数超过 ⌊ n/3 ⌋ 次的数
摘要: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 阅读全文
posted @ 2016-08-25 17:51 ArgenBarbie 阅读(367) 评论(0) 推荐(0)
218. The Skyline Problem *HARD* -- 矩形重叠
摘要: A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are give 阅读全文
posted @ 2016-08-25 17:07 ArgenBarbie 阅读(143) 评论(0) 推荐(0)
221. Maximal Square -- 矩阵中1组成的最大正方形
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma 阅读全文
posted @ 2016-08-25 15:51 ArgenBarbie 阅读(235) 评论(0) 推荐(0)
输出有序数组的中两个元素差值为指定值diff的两个元素
摘要: 题目: 输出有序数组的中两个元素差值为指定值diff的两个元素。 思路: 这与输出两个元素的和的值为一定值类似,需要两个指针,不同的是:指针不是一左一右,而是一前一后。 如果差值等于diff,则返回;如果差值大于diff,则左指针右移;如果差值小于diff,则右指针右移。 阅读全文
posted @ 2016-08-25 14:50 ArgenBarbie 阅读(529) 评论(0) 推荐(0)
5. Longest Palindromic Substring -- 最长回文字串
摘要: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes 阅读全文
posted @ 2016-08-25 10:30 ArgenBarbie 阅读(156) 评论(0) 推荐(0)
79. 212. Word Search *HARD* -- 字符矩阵中查找单词
摘要: 79. Word Search Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent ce 阅读全文
posted @ 2016-08-25 09:48 ArgenBarbie 阅读(177) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3