- (NSArray *)filterArray:(NSArray *)paramArray{
NSMutableDictionary *filterDic = [NSMutableDictionary dictionary];
NSMutableDictionary *duplicateDic = [NSMutableDictionary dictionary];
for (NSString *sting in paramArray) {
if (![filterDic valueForKey:sting]) {
[filterDic setValue:@1 forKey:sting];
}else{
[duplicateDic setValue:@1 forKey:sting];
}
}
return duplicateDic.allKeys;
}
NSArray *duplicateArr = [self filterArray:@[@"a",@"b",@"c",@"d",@"a",@"c",@"c",@"f",@"f",@"eg",@"ev",@"aa",@"ev"]];
NSLog(@"%@",duplicateArr);