Here s the solution from Topcoder.com/tc
http://www.topcoder.com/tc?module=Static&d1=match_editorials&d2=srm405
On Fri, Jan 21, 2011 at 12:54 PM, radha krishnan
wrote:
> Whats the range of length ?
>
> On Fri, Jan 21, 2011 at 11:42 AM, snehal jain wrote:
>> An ideal string is a string where the
Whats the range of length ?
On Fri, Jan 21, 2011 at 11:42 AM, snehal jain wrote:
> 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 (quo
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’ oc