An ideal string is a string where the 1-based index of the first
occurrence of each letter is equal to the number of occurrences of
that letter in the string. For example, the “BAOOOA” is an ideal
string (quotes for clarity only). The letter ‘B’ appears 1 time, and
its index is 1. The letter ‘A’ occurs 2 times and its first index is
2. The letter ‘O’ occurs 3 times and its first index is 3.

Given an int length, return the lexicographical smallest ideal string
of that length containing only uppercase letters (‘A’-'Z’). If there
are no such ideal strings of that length, return an empty String
instead.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to