• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2016年12月2日
Leetcode: Add Strings
摘要: Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is =0 || j>=0 || carry!=0) { 8 int sum = 0; ... 阅读全文
posted @ 2016-12-02 12:46 neverlandly 阅读(324) 评论(0) 推荐(0)
Leetcode: Longest Palindrome
摘要: Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for example "Aa" is not cons... 阅读全文
posted @ 2016-12-02 12:26 neverlandly 阅读(255) 评论(0) 推荐(0)
Leetcode: Queue Reconstruction by Height
摘要: refer to: https://discuss.leetcode.com/topic/60394/easy-concept-with-python-c-java-solution E.g.input: [[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]]subar 阅读全文
posted @ 2016-12-02 11:58 neverlandly 阅读(371) 评论(0) 推荐(0)
Leetcode: Convert a Number to Hexadecimal
摘要: 记住要delete begining 0 要记住单独处理 num == 0的情况 阅读全文
posted @ 2016-12-02 11:06 neverlandly 阅读(409) 评论(0) 推荐(0)
Leetcode: Frog Jump
摘要: Solution 1: Backtracking, but will TLE Better Solution: DP (refer to https://discuss.leetcode.com/topic/59903/very-easy-to-understand-java-solution-wi 阅读全文
posted @ 2016-12-02 08:35 neverlandly 阅读(773) 评论(0) 推荐(0)
Leetcode: Binary Watch
摘要: Solution 1: Bit Manipulation use Integer.bitCount() Solution 2: Backtracking, 非常精妙之处在于用了两个数组来帮助generate digit(例如:1011 -> 11) 阅读全文
posted @ 2016-12-02 05:00 neverlandly 阅读(246) 评论(0) 推荐(0)
Leetcode: Evaluate Division
摘要: Graph, DFS (1) Build the map, the key is dividend, the value is also a map whose key is divisor and value is its parameter. For example, a / b = 2.0, 阅读全文
posted @ 2016-12-02 02:10 neverlandly 阅读(330) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3