I have an array like this
A = [@"aa",@"cc",@"bb",@"bb",@"cc",@"aa",@"cc"]
I need to convert it to
A = [@"x2 aa",@"x2 bb",@"x3 cc"]
I have an array like this
A = [@"aa",@"cc",@"bb",@"bb",@"cc",@"aa",@"cc"]
I need to convert it to
A = [@"x2 aa",@"x2 bb",@"x3 cc"]
Count the similar elements and create a new string, add it to new array. As shown here:
Output: