• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2016年12月1日
Leetcode: Fizz Buzz
摘要: Solution 1: Solution with out using % 阅读全文
posted @ 2016-12-01 12:46 neverlandly 阅读(423) 评论(0) 推荐(0)
Leetcode: Integer Replacement
摘要: Refer to: https://discuss.leetcode.com/topic/58334/a-couple-of-java-solutions-with-explanations/2 When to add 1 instead of minus 1, here is an example 阅读全文
posted @ 2016-12-01 12:31 neverlandly 阅读(366) 评论(0) 推荐(0)
Leetcode: Longest Substring with At Least K Repeating Characters
摘要: Analysis: Given a string s, find out all chars that are invalid (i.e., count < k). The longest substring must reside in one of the substrings divided 阅读全文
posted @ 2016-12-01 11:33 neverlandly 阅读(429) 评论(0) 推荐(0)
Leetcode: Rotate Function
摘要: F(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25 [4, 3, 2, 6] F(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16 [6, 阅读全文
posted @ 2016-12-01 08:12 neverlandly 阅读(226) 评论(0) 推荐(0)
Leetcode: UTF-8 Validation
摘要: 这道题题干给出了判断 one single UTF-8 char的方法,然后给一个UTF-8 char sequence,判断是不是正确sequence. (读题读了很久) 这道题关键是要学到用 & 取出一个bit sequence当中几位的方法 二进制数表示法:在前面加 0b, 八进制加0o, 十 阅读全文
posted @ 2016-12-01 07:09 neverlandly 阅读(733) 评论(0) 推荐(0)
Leetcode: Decode String
摘要: 自己的做法:这种括号问题肯定是用栈,最好是先在栈里存一个空元素,然后stack.peek().append()各种操作 一个栈存string, 一个栈存number, 维护一个指针numStart指向数字的开始 1. 遇到数字啥也不做 2. 遇到char: stack.peek().append(c 阅读全文
posted @ 2016-12-01 05:07 neverlandly 阅读(474) 评论(0) 推荐(0)
Leetcode: Perfect Rectangle
摘要: Refer to https://discuss.leetcode.com/topic/56052/really-easy-understanding-solution-o-n-java and https://discuss.leetcode.com/topic/55923/o-n-solutio 阅读全文
posted @ 2016-12-01 02:12 neverlandly 阅读(563) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3