Company: Bookings holding_25july
Difficulty: medium
Palindrome Check You are given a string S of length N consisting only of lowercase English letters. You may rearrange the letters of S in any order (that is, form any anagram of S , including S itself). Determine whether at least one anagram of S is a palindrome - a string that reads the same forwards and backwards. Print YES if such an anagram exists, otherwise print NO . Input Format The first line contains an integer N , the length of the string. The second line contains the string S . Output Format Print a single line containing YES if some anagram of S is a palindrome, or NO otherwise. (inferred - the answer is printed in uppercase exactly as shown.) Constraints 1 <= N <= 10 5 'a' <= S[i] <= 'z' S has exactly N characters. (inferred - the source does not say so explicitly; every test case satisfies it.) Each input file contains exactly one test case. (inferred) Examples Example 1 Input: 5 abcab Output: YES Explanation: The letters can be rearranged into abcba , which i