• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2015年12月23日
Leetcode: Paint House II
摘要: There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain color is different. Yo 阅读全文
posted @ 2015-12-23 13:31 neverlandly 阅读(993) 评论(0) 推荐(0)
Leetcode: Palindrome Permutation II
摘要: Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form... 阅读全文
posted @ 2015-12-23 12:53 neverlandly 阅读(348) 评论(0) 推荐(0)
Leetcode: Palindrome Permutation
摘要: Given a string, determine if a permutation of the string could form a palindrome.For example,"code" -> False, "aab" -> True, "carerac" -> True.Hint:Co... 阅读全文
posted @ 2015-12-23 11:32 neverlandly 阅读(235) 评论(0) 推荐(0)
Leetcode: Ugly Number
摘要: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2015-12-23 06:59 neverlandly 阅读(230) 评论(0) 推荐(0)
Leetcode: Ugly Number II
摘要: Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6... 阅读全文
posted @ 2015-12-23 06:48 neverlandly 阅读(277) 评论(0) 推荐(0)
Leetcode: Single Number III
摘要: Lintcode 也有这道题 Single Number III example: 1 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 如例所示,最后两个数8, 阅读全文
posted @ 2015-12-23 05:43 neverlandly 阅读(232) 评论(0) 推荐(0)
Leetcode: 3Sum Smaller
摘要: Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 =2; i--) { 6 //if (i!=nums.length-1 && (n... 阅读全文
posted @ 2015-12-23 04:47 neverlandly 阅读(322) 评论(0) 推荐(0)
Leetcode: Factor Combinations
摘要: Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer n and return all possib 阅读全文
posted @ 2015-12-23 02:33 neverlandly 阅读(475) 评论(0) 推荐(0)
Leetcode: Different Ways to Add Parentheses
摘要: 用到了Divide and Conquer, 跟 Leetcode: Unique Binary Search Trees II 很像 在input string里遍历各个operator, 依据每个operator分成左右子串,左右子串做递归返回所有可能的results,然后全排列。 注意很巧妙的 阅读全文
posted @ 2015-12-23 00:43 neverlandly 阅读(332) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3