摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).The replacement must be in-place, do not allocate extra memory.He 阅读全文
posted @ 2013-07-29 22:19 冰点猎手 阅读(471) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return 1 since the palindrome partitioning ["aa","b"] could be produced using 1 cut. 分 阅读全文
posted @ 2013-07-29 21:03 冰点猎手 阅读(162) 评论(0) 推荐(0)