Smallest Palindrome

0

0 votes
Easy
Problem

Given a palindrome of length N consisting only of lowercase letters , output the minimum possible length of palindrome which can be formed by deleting the characters of the original string . However there is a catch , the required palindrome should contain atleast 1 occurence of all the unique characters in the original string .

INPUT :

The first line of input contains a single integer N, denoting length of string .

The second line of input contains a string S.

OUTPUT :

Output a single integer , the required length of palindrome .

CONSTRAINTS :

1N500

Sample Input
6
babbab
Sample Output
3
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?