摘要: 题目: There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjac 阅读全文
posted @ 2017-03-06 07:21 panini 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a fl 阅读全文
posted @ 2017-03-06 07:01 panini 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 阅读全文
posted @ 2017-03-06 06:20 panini 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string, determine if a permutation of the string could form a palindrome. For example,"code" -> False, "aab" -> True, "carerac" -> True. H 阅读全文
posted @ 2017-03-06 06:14 panini 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2017-03-06 06:01 panini 阅读(77) 评论(0) 推荐(0) 编辑