You are given two strings $$S$$ and $$T$$ of equal lengths. You need to pick some characters from the first string, some from the second string and then form a new string by rearranging the characters you have picked. You need to find the length of the maximum string that you can make which will be a palindrome.
Input
The first line contains a string $$S$$ as input and the next line contains a string $$T$$ as input.
Output
In the output, you need to print an integer which denotes the maximum length of the palindrome that can be obtained.
Constraints
$$1 \le |S| , |T| \le 1000$$
In the sample test case, you can form the string baaab by picking the characters from both the strings.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor