CtCI-6th-Edition-JavaScript-ES2015 icon indicating copy to clipboard operation
CtCI-6th-Edition-JavaScript-ES2015 copied to clipboard

Add one more solution 'isPalindromePermutationsBit' to ch1-q4, fix issue #3 .

Open Carr1005 opened this issue 7 years ago • 0 comments

  • 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. 2018-03-04 10 52 27
  • For #3 which @viatsko mentioned, add .toLowerCase() to make input which contains uppercase letters available, also add one input for testing in test code.

Carr1005 avatar Mar 04 '18 14:03 Carr1005