CtCI-6th-Edition-JavaScript-ES2015
CtCI-6th-Edition-JavaScript-ES2015 copied to clipboard
Add one more solution 'isPalindromePermutationsBit' to ch1-q4, fix issue #3 .
- Add a solution described in CtCI-6th, which use a number as bit vector, toggle the bits. Check that at most one bit is set to 1 subsequently. Space complexity: O(1).
- In this method, we need to assume input string only contains English alphabet and space, so revise the test code to filter the unacceptable inputs to this new method.
- For #3 which @viatsko mentioned, add
.toLowerCase()to make input which contains uppercase letters available, also add one input for testing in test code.