i have an array like
[chapter,indent,left,indent,nonindent,chapter,chapter,indent,indent,left];
i need to find indexes of duplicates and also non duplicate elements . how to do this...........give some sample code or logic...... thanks in advance
iam using objective c.....
    NSArray *myWords = [string componentsSeparatedByString:@"class=\""];
    int count_var=[myWords count];
    tmp1=@"";
    for(int i=1;i<count_var;i++)
    {
        str=[NSString stringWithFormat:@"\n%@",[myWords objectAtIndex:i]];
        class=[str componentsSeparatedByString:@"\""];
        NSString *tmp=[NSString stringWithFormat:@"%@",[class objectAtIndex:0]];
        tmp1=[[NSString stringWithFormat:@"%@",tmp1] stringByAppendingString:[NSString stringWithFormat:@"%@",tmp]];
    } 
    t1.editable=NO;
    t1.text=tmp1;
NSArray *tempo=[[NSArray alloc]init];
tempo=[tmp1 componentsSeparatedByString:@"\n"];
tempCount=[tempo count];
this is my sample code...in this the array tempo contains all objects from that array i want to get index of duplicate strings≥.