I have an array that describes a list of auto parts (Swift/IOS,array already in such structure arrived from other source.):
let parts = [
"Wheel = 230$",
"Door = 200$",
"Wheel = 300$",
"Seat = 150$",
"Seat = 150$",
"Rugs = 100$"]
I need to calculate the sum of the prices of the auto parts for each type of part. Here's the result I'm looking for:
let expectedResult = [
"wheel 530$",
"Door 200$",
"Seat 300$",
"Rugs 100$"
]
I don’t understand how to do it.