• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2016年11月23日
Leetcode: Reverse String
摘要: After the API changes 注意没有append(0, s.charAt(i)), 是sb.insert(0, charAt(i)); 阅读全文
posted @ 2016-11-23 12:20 neverlandly 阅读(303) 评论(0) 推荐(0)
Leetcode: Power of Four
摘要: it's easy to find that power of 4 numbers have those 3 common features. First,greater than 0. Second,only have one '1' bit in their binary notation,so 阅读全文
posted @ 2016-11-23 11:48 neverlandly 阅读(245) 评论(0) 推荐(0)
Leetcode: House Robber III
摘要: https://discuss.leetcode.com/topic/39834/step-by-step-tackling-of-the-problem rob(root) which will return the maximum amount of money that we can rob 阅读全文
posted @ 2016-11-23 11:17 neverlandly 阅读(326) 评论(0) 推荐(0)
Leetcode: Counting Bits
摘要: Hint: 阅读全文
posted @ 2016-11-23 07:36 neverlandly 阅读(359) 评论(0) 推荐(0)
Leetcode: Palindrome Pairs
摘要: Naive Solution: Time: O(n^2*k) with n the total number of words in the "words" array and k the average length of each word: check each combination see 阅读全文
posted @ 2016-11-23 06:29 neverlandly 阅读(362) 评论(0) 推荐(0)
Leetcode: Self Crossing
摘要: 4th line may cross with 1st line, and so on: 5th with 2nd, ...etc 5th line may cross with 1st line, and so on: 6th with 2nd, ...etc 6th line also may 阅读全文
posted @ 2016-11-23 03:51 neverlandly 阅读(381) 评论(0) 推荐(0)
Leetcode: Increasing Triplet Subsequence
摘要: Naive Solution: use DP, Time O(N^2), Space O(N) dp[i] represents the length of longest increasing subsequence till i including element i in nums array 阅读全文
posted @ 2016-11-23 01:42 neverlandly 阅读(363) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3