[Solved] How to remove duplicates in an array by using only one for loop?


Try This:

NSArray *inputArray = @[11, 45, 54, 32, 11, 56, 45, 76, 23, 87, 54, 45];
NSArray *outputArray = [inputArray valueForKeyPath:@"@distinctUnionOfObjects.self"];

Hope it Helps!!

solved How to remove duplicates in an array by using only one for loop?