Company: UKG
Difficulty: medium
Anagram Period A string t is an anagram of a string s when t can be obtained by rearranging the characters of s . In particular, every anagram of s has exactly the same length as s . You are given a string input_str of length n made up of lowercase English letters. Pick a string s and split input_str into consecutive pieces t1, t2, ..., tm (with m >= 1 ) so that input_str = t1 + t2 + ... + tm and every piece ti is an anagram of s . The pieces must use up the whole of input_str , with no characters left over. Report the smallest possible length of s . Complete the function getAnagramPeriod , which receives input_str and returns the answer as an integer. Input Format A single line containing the string input_str . Output Format A single line containing one integer: the smallest possible length of s . Constraints 1 <= n <= 100000 , where n is the length of input_str input_str contains only lowercase English letters, 'a' to 'z' The answer is an integer between 1 and n , so a 32-bi