Give a string, which only contains a-z. List all the permutation of upcase and lowcase. For example, str = "ab", the output should be "ab", "aB", "Ab", "AB" for str = "abc", the output should be…
Given two strings, write a method to decide if one is a permutation of the other. Example abcd is a permutation of bcad, but abbe is not a permutation of abe public class Solution { /** * @param A a string * @param B a string * @return a boolean */ p…
Description Given two strings, write a method to decide if one is a permutation of the other. Example abcd is a permutation of bcad, but abbe is not a permutation of abe 解题:遇到过类似的题目,比较简单的方法是,把字符串转化为字符数组,然后排序.比较每一位的数是否相等.这样做效率比较低,代码如下: public class So…
Palindrome Permutation I Given a string, determine if a permutation of the string could form a palindrome. For example,"code" -> False, "aab" -> True, "carerac" -> True. Hint: Consider the palindromes of odd vs even…
The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following sequence for n = 3: "123" "132" "213" "231" "312" "321&…
Yet Another Source Code for LintCode Current Status : 232AC / 289ALL in Language C++, Up to date (2016-02-10) For more problems and solutions, you can see my LintCode repository. I'll keep updating for full summary and better solutions. See cnblogs t…