Re: [algogeeks] Ideal String

2011-01-20 Thread radha krishnan
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

Re: [algogeeks] Ideal String

2011-01-20 Thread radha krishnan
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

[algogeeks] Ideal String

2011-01-20 Thread snehal jain
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