Longest Palindrome

easy
1.Given a string which consists of lowercase or uppercase letters 2.Find the length of the longest palindromes that can be built with those letters. 3.Your taks is to complete the function longestPalindrome() which should return the the length of the longest palindromes that can be built with those letters. 4.This is case sensitive, for example "Aa" is not considered a palindrome here. 5.Example For string abccccdd the output is 7 as One longest palindrome that can be built is "dccaccd", whose length is 7.

Input Format

Single line containing a String 'S'

Output Format

Function should return the length of the longest palindrome.

Constraints

Assume the length of given string will not exceed 1,010.

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
awdeelkjup
Output
3
Previous
Longest K Unique Characters Substring
Next
Longest Sub Array With Sum K

Related Questions