Question: Part 1 : Programming ( 7 0 points ) 1 . ( 2 5 points ) A palindrome is a string that reads the same
Part : Programming points
points A palindrome is a string that reads the same backward as forward. For example,
madam and test tset are palindromes but banana is not. Given a string s write a function
canFormPalindromes that tests whether the letters in s can be permuted to form a palindrome.
Note:
Your algorithm must use hashing or dictionary in Python
The time complexity is On where n is the length of the input string.
Assume an empty string is a palindrome.
Examples:
canFormPalindromeaamdm should return True
Explanation: aamdm can be permuated to madam which is a palindrome.
canFormPalindromeabbddaaa should return True
Explanation: abbddaaa can be permuated to aabddbaa which is a palindrome.
canFormPalindromeabcc should return False
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
