Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Carr1005
Copy link

@Carr1005 Carr1005 commented Mar 4, 2018

  • 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 About ch 1 ex 4 solution #3 which @viatsko mentioned, add .toLowerCase() to make input which contains uppercase letters available, also add one input for testing in test code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant