摘要: Given a string, determine if a permutation of the string could form a palindrome. For example,"code" -> False, "aab" -> True, "carerac" -> True. Analy 阅读全文
posted @ 2016-09-20 11:31 amazingzoe 阅读(169) 评论(0) 推荐(0)
摘要: Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f 阅读全文
posted @ 2016-09-20 06:26 amazingzoe 阅读(152) 评论(0) 推荐(0)
摘要: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes 阅读全文
posted @ 2016-09-20 05:59 amazingzoe 阅读(232) 评论(0) 推荐(0)
摘要: Description: Count the number of prime numbers less than a non-negative number, n. Analyse: start from 2, label 2 * 2, 2 * 3... as false; then move to 阅读全文
posted @ 2016-09-20 04:23 amazingzoe 阅读(132) 评论(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 floati 阅读全文
posted @ 2016-09-20 00:50 amazingzoe 阅读(124) 评论(0) 推荐(0)